<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
      v-if="this.quanxian == false"
    >
      <el-form-item label="商户名称" prop="shopname" style="width: 250px">
        <el-input
          v-model="queryParams.shopname"
          placeholder="请输入商户名称"
          clearable
          style="width: 150px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商户地址" prop="shopaddress" style="width: 250px">
        <el-cascader
          filterable
          size="large"
          ref="cascader"
          :options="options"
          v-model="queryParams.selectedOptions"
          style="width: 180px"
          :props="defaultParams"
          @change="handleChange"
        >
        </el-cascader>
      </el-form-item>
      <el-form-item label="负责人" prop="shopuser" style="width: 250px">
        <el-input
          v-model="queryParams.shopuser"
          placeholder="请输入商家负责人"
          clearable
          style="width: 150px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客服电话" prop="shoptel" style="width: 250px">
        <el-input
          v-model="queryParams.shoptel"
          placeholder="请输入门店接听电话"
          clearable
          style="width: 150px"
          @keyup.enter.native="handleQuery"
          onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')"
        />
      </el-form-item>
      <el-form-item label="店铺状态" prop="state" style="width: 250px">
        <el-select
          v-model="queryParams.state"
          placeholder="店铺状态"
          clearable
          style="width: 150px"
        >
          <el-option
            v-for="dict in state"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="拍摄种类" prop="shopType">
        <el-select
          v-model="queryParams.shopType"
          placeholder="拍摄种类"
          clearable
          style="width: 150px"
        >
          <el-option
            v-for="dict in shopType"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="入驻时间">
        <el-date-picker
          v-model="queryParams.starttime"
          type="date"
          value-format="timestamp"
          :picker-options="startDatePicker"
          placeholder="开始时间"
          style="width: 150px"
        >
        </el-date-picker>
        <el-date-picker
          v-model="queryParams.endtime"
          type="date"
          value-format="timestamp"
          :picker-options="endDatePicker"
          placeholder="结束时间"
          style="width: 150px"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          v-hasPermi="['shop:userlist:query']"
          size="mini"
          @click="handleQuery"
          >搜索
        </el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
      </el-form-item>
    </el-form>
    <!-- v-if="this.quanxian == true" -->
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['shop:userlist:add']"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          v-hasPermi="['shop:userlist:close']"
          plain
          icon="el-icon-edit"
          size="mini"
          @click="handleClose(searchdata)"
          >关闭账号
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['shop:userlist:export']"
          >导出</el-button
        >
      </el-col>

      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>
    <el-table
      v-loading="loading"
      :data="businessList"
      @selection-change="handleSelectionChange"
      max-height="700"
      :row-style="rowStyle"
      :default-sort="{
        prop: 'zkwlBusinessUsPC.createtime',
        order: 'descending',
      }"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="商户名称/商家账号" align="center">
        <template slot-scope="scope">
          <div>{{ scope.row.shopname }}</div>
          <div>{{ scope.row.zkwlBusinessUsPC.shopnumber }}</div>
        </template>
      </el-table-column>
      <el-table-column label="负责人/联系方式" align="center">
        <template slot-scope="scope">
          <div>{{ scope.row.zkwlBusinessUsPC.shopuser }}</div>
          <div>{{ scope.row.zkwlBusinessUsPC.shoptel }}</div>
        </template>
      </el-table-column>
      <!-- <el-table-column label="接单类型/合作模式" align="center">
                <template slot-scope="scope">
                    <div>{{ scope.row.shopname }}</div>
                    <div>{{ scope.row.zkwlBusinessUsPC.shopnumber }}</div>
                </template>
            </el-table-column>
            <el-table-column label="婚选商务人" align="center" prop="" />
            <el-table-column label="起拍价" align="center" prop="" />
        -->
      <!-- <el-table-column label="剩余客资条数/成交余额" align="center">
                <template slot-scope="scope">
                    <div>{{ scope.row.shopname }}</div>
                    <div>{{ scope.row.zkwlBusinessUsPC.shopnumber }}</div>
                </template>
            </el-table-column> -->
      <!-- <el-table-column label="商家账号" align="center" prop="" /> -->
      <el-table-column
        label="负责人"
        align="center"
        prop="zkwlBusinessUsPC.shopuser"
      />
      <el-table-column
        label="联系方式"
        align="center"
        prop="zkwlBusinessUsPC.shoptel"
      />
      <el-table-column label="拍摄种类" align="center" prop="shopType" />
      <el-table-column label="客资余额" align="center" prop="shopcmMoney" />
      <el-table-column label="成交余额" align="center" prop="shopdealMoney" />
      <el-table-column
        label="店铺状态"
        align="center"
        prop="zkwlBusinessUsPC.state"
        type="text"
      >
        <template slot-scope="scope">
          <span v-if="scope.row.zkwlBusinessUsPC.state == '1'">禁用</span>
          <span v-if="scope.row.zkwlBusinessUsPC.state == '0'">正常</span>
        </template>
      </el-table-column>
      <el-table-column
        label="入驻时间"
        align="center"
        prop="zkwlBusinessUsPC.createtime"
      >
        <template slot-scope="scope">
          <span>{{
            parseTime(scope.row.zkwlBusinessUsPC.createtime, "{YY}-{MM}-{DD}")
          }}</span>
        </template>
      </el-table-column>
      <el-table-column label="商户地址" align="center" prop="shopaddress" />
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
        fixed="right"  width="180"
      >
        <template slot-scope="scope">
          <div class="cz">
            <div class="zuofei" @click="handleCZ(scope.row)">
              <img src="@/assets/images/cz.png" alt="" />
              <span>充值</span>
            </div>
            <div class="transform_seller" @click="getThisShopAllMessageById(scope.row.shopid)" >
              <img src="@/assets/images/detail.png" alt=""/>
              <span>详细信息</span>
            </div>
          </div>
          <!-- <el-button size="mini" type="text" icon="el-icon-edit" v-hasPermi="['shop:userlist:edit']"
                        @click="handleUpdate(scope.row)">修改
                    </el-button>
                    <el-button size="mini" type="text" icon="el-icon-edit" v-hasPermi="['shop:userlist:look']"
                        @click="handlechakan(scope.row)">查看
                    </el-button>
                    <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"
                        v-hasPermi="['shop:userlist:more']">
                        <span class="el-dropdown-link">
                            <i class="el-icon-d-arrow-right el-icon--right"></i>更多
                        </span>
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item command="shopInformation" v-hasPermi="['shop:userlist:shopinfo']"
                                icon="el-icon-circle-check">店铺信息
                            </el-dropdown-item>
                            <el-dropdown-item command="shopKz" icon="el-icon-circle-check"
                                v-hasPermi="['shop:userlist:shopkz']">商家客资</el-dropdown-item>
                            <el-dropdown-item v-hasPermi="['shop:userlist:zhaungxiu']" command="shopDecoration"
                                icon="el-icon-circle-check">店铺装修
                            </el-dropdown-item>
                            <el-dropdown-item v-hasPermi="['shop:userlist:bendianyuangong']" command="shopUser"
                                icon="el-icon-circle-check">本店员工</el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown> -->
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <!-- 添加对话框 -->
    <el-dialog
      :title="title"
      :visible.sync="open"
      width="800px"
      append-to-body
      @close="close"
    >
      <el-form ref="form" :model="form" :rules="rules" label-width="150px">
        <el-form-item
          label="店铺商家logo或头像"
          prop="shoplogo"
          style="width: 380px"
        >
          <!-- v-loading.lock="loading1" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0,0,0,0.1)" -->
          <el-upload
            class="avatar-uploader"
            :action="url"
            accept=".jpg, .png"
            :headers="headers"
            :show-file-list="false"
            :on-success="handleAvatarSuccess"
            :before-upload="beforeAvatarUpload"
            :on-progress="progress"
            name="fileName"
          >
            <img v-if="form.shoplogo" :src="form.shoplogo" class="avatar" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            <el-progress
              v-if="isShowJinDuTiao"
              type="circle"
              :percentage="percentage"
              :width="78"
              class="jdt"
            />
            <div slot="tip" class="el-upload__tip" style="color: #999999">
              上传图片为正方形
            </div>
          </el-upload>
        </el-form-item>
        <el-form-item label="店铺背景图片" prop="shopbackPic">
          <el-upload
            class="avatar-uploader"
            :action="url"
            accept=".jpg, .png"
            :headers="headers"
            :show-file-list="false"
            :on-success="shopbackPicSuccess"
            :before-upload="shopbackPicUpload"
            :on-progress="progress1"
            name="fileName"
          >
            <img
              v-if="form.shopbackPic"
              :src="form.shopbackPic"
              class="avatar"
            />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            <el-progress
              v-if="isShowJinDuTiao1"
              type="circle"
              :percentage="percentage1"
              :width="78"
              class="jdt"
            />
            <div slot="tip" class="el-upload__tip" style="color: #999999">
              上传图片大小为750px*520px
            </div>
          </el-upload>
        </el-form-item>
        <el-form-item
          label="商铺门头照片"
          prop="shopMphone"
          style="width: 380px"
        >
          <el-upload
            class="avatar-uploader"
            :action="url"
            accept=".jpg, .png"
            :headers="headers"
            :show-file-list="false"
            :on-success="shopMphoneSuccess"
            :before-upload="beforeshopMphoneUpload"
            :on-progress="progress2"
            name="fileName"
          >
            <img v-if="form.shopMphone" :src="form.shopMphone" class="avatar" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            <el-progress
              v-if="isShowJinDuTiao2"
              type="circle"
              :percentage="percentage2"
              :width="78"
              class="jdt"
            />
          </el-upload>
        </el-form-item>
        <el-form-item label="商铺营业执照" prop="shopBusinessLicense">
          <el-upload
            class="avatar-uploader"
            :action="url"
            accept=".jpg, .png"
            :headers="headers"
            :show-file-list="false"
            :on-progress="progress3"
            :before-upload="beforeshopBusinessLicenseUpload"
            :on-success="shopBusinessLicenseSuccess"
            name="fileName"
          >
            <img
              v-if="form.shopBusinessLicense"
              :src="form.shopBusinessLicense"
              class="avatar"
              :preview-src-list="srcList5"
            />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            <el-progress
              v-if="isShowJinDuTiao3"
              type="circle"
              :percentage="percentage3"
              :width="78"
              class="jdt"
            />
          </el-upload>
        </el-form-item>
        <el-form-item label="商户标签1" prop="shoptype1">
          <el-input
            v-model.trim="form.shoptype1"
            placeholder="请输入商户标签"
          />
        </el-form-item>
        <el-form-item label="商户标签2" prop="shoptype2">
          <el-input v-model="form.shoptype2" placeholder="请输入商户标签" />
        </el-form-item>
        <el-form-item label="商户标签3" prop="shoptype3">
          <el-input v-model="form.shoptype3" placeholder="请输入商户标签" />
        </el-form-item>
        <el-form-item label="商户名称" prop="shopname">
          <el-input v-model.trim="form.shopname" placeholder="请输入商户名称" />
        </el-form-item>
        <el-form-item label="商户排序" prop="shopTop">
          <el-input v-model="form.shopTop" placeholder="请输入商户排序" />
        </el-form-item>
        <el-form-item label="商家账号" prop="shopnumber">
          <el-input
            v-model.trim="form.shopnumber"
            placeholder="请输入商家账号"
          />
        </el-form-item>
        <el-form-item label="商家密码" prop="password">
          <el-input v-model="form.password" placeholder="请输入商家密码" />
        </el-form-item>
        <!-- 1--金 2--银 3--优选商家 -->
        <el-form-item label="商家等级" prop="type">
          <el-select
            v-model="form.type"
            placeholder="请输入商家等级"
            clearable
            style="width: 204px"
          >
            <el-option
              v-for="dict in type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="当前负责人" prop="shopuser">
          <el-input
            v-model.trim="form.shopuser"
            placeholder="请输入当前负责人"
          />
        </el-form-item>
        <el-form-item label="客服电话" prop="shoptel">
          <el-input
            v-model.trim="form.shoptel"
            placeholder="请输入门店接听电话"
            maxlength="11"
            oninput="value=value.replace(/[^0-9-]+/,'')"
          />
        </el-form-item>
        <!-- 1--婚纱摄影  2--婚纱礼服  3--婚礼策划  4--婚宴酒店 -->
        <el-form-item label="商家类型" prop="shopType" style="width: 350px">
          <el-select
            v-model.trim="form.shopType"
            placeholder="请输入商家类型"
            clearable
            style="width: 204px"
          >
            <el-option
              v-for="dict in shopType"
              :key="dict.key"
              :label="dict.label"
              :value="dict.label"
            />
          </el-select>
        </el-form-item>
        <!-- 0--正常  1--关闭 -->
        <el-form-item label="商家状态" prop="state">
          <el-select
            v-model.trim="form.state"
            placeholder="请输入商家状态"
            clearable
            style="width: 204px"
          >
            <el-option
              v-for="dict in state"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <!-- 搜索 -->
        <el-form-item label="地图搜索">
          <el-amap-search-box
            ref="searchBox"
            class="search-box"
            style="width: 550px; height: 36px"
            :default="defaultValue"
            :search-option="searchOption"
            :on-search-result="onSearchResult"
            @input="searchValue = $event.target.value"
          >
          </el-amap-search-box>
        </el-form-item>
        <!-- 地图 -->
        <el-form-item label="地图">
          <el-amap
            ref="map"
            vid="amapDemo"
            :events="events"
            :center="center"
            :zoom="zoom"
            class="amap-demo"
            style="width: 550px; height: 180px"
          >
            <el-amap-marker :position="center" key="100"></el-amap-marker>
          </el-amap>
        </el-form-item>
        <el-form-item label="商家地址" prop="shopaddress" style="width: 350px">
          {{ form.shopaddress || "请在地图上选择商家地址" }}
          <!-- <el-input v-model.trim="form.shopaddress" placeholder="请在地图上搜索商家地址" /> -->
        </el-form-item>
        <el-form-item label="商家详细地址" prop="shopaddressb">
          <el-input
            placeholder="请输入商家详细地址"
            v-model="form.shopaddressb"
          ></el-input>
        </el-form-item>
        <el-form-item label="商家经纬度" prop="shopJwd" style="width: 350px">
          {{ form.shopJwd || "请在地图上选择商家地址" }}
          <!-- <el-input v-model.trim="form.shopJwd" placeholder="如111.1111,111.1111"></el-input> -->
        </el-form-item>
        <el-form-item label="商家简介" prop="shopbrief">
          <el-input
            v-model.trim="form.shopbrief"
            type="textarea"
            placeholder="请输入商家简介"
          ></el-input>
        </el-form-item>
        <el-form-item label="最高价格" prop="shopmaxPrice">
          <el-input
            v-model.trim="form.shopmaxPrice"
            placeholder="请输入最高价格"
          />
        </el-form-item>
        <el-form-item label="最低价格" prop="shopminPrice">
          <el-input
            v-model.trim="form.shopminPrice"
            placeholder="请输入最低价格"
          />
        </el-form-item>
        <el-form-item label="客资扣费标准" prop="shopspendCmMoney">
          <el-input
            v-model.trim="form.shopspendCmMoney"
            placeholder="请输入客资扣费标准"
          />
        </el-form-item>
        <!-- <el-form-item label="成交订单扣费界限" prop="shopxiane">
                    <el-input v-model.trim="form.shopxiane" placeholder="成交订单扣费界限" />
                </el-form-item> -->
        <el-form-item label="成交扣费标准" prop="shopspendDealMoney">
          <el-input
            v-model.trim="form.shopspendDealMoney"
            placeholder="请输入成交扣费标准"
          />
        </el-form-item>
        <!--成交扣费比率min=1% max=100%  -->
        <el-form-item label="成交扣费比率" prop="shoprate" style="width: 710px">
          <!-- <el-input v-model.trim="form.shoprate" placeholder="请输入成交扣费比率,如5%" /> -->
          <!-- style="width: 800px;" -->
          <template>
            <div class="block">
              <el-slider v-model="form.shoprate" show-input></el-slider>
            </div>
          </template>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" :disabled="lock" @click="xinzeng"
          >确 定</el-button
        >
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 修改对话框 -->
    <el-dialog
      :title="title1"
      :visible.sync="open1"
      width="800px"
      append-to-body
      @close="close"
    >
      <el-form ref="form" :model="form" :rules="rules" label-width="150px">
        <el-form-item
          label="店铺商家logo或头像"
          prop="shoplogo"
          style="width: 380px"
        >
          <el-upload
            class="avatar-uploader"
            :action="url"
            accept=".jpg, .png"
            :headers="headers"
            :show-file-list="false"
            :on-success="handleAvatarSuccess"
            :before-upload="beforeAvatarUpload"
            :on-progress="progress"
            name="fileName"
          >
            <img v-if="form.shoplogo" :src="form.shoplogo" class="avatar" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            <el-progress
              v-if="isShowJinDuTiao"
              type="circle"
              :percentage="percentage"
              :width="78"
              class="jdt"
            />
            <div slot="tip" class="el-upload__tip" style="color: #999999">
              上传图片为正方形
            </div>
          </el-upload>
        </el-form-item>
        <el-form-item label="店铺背景图片" prop="shopbackPic">
          <el-upload
            class="avatar-uploader"
            :action="url"
            accept=".jpg, .png"
            :headers="headers"
            :show-file-list="false"
            :on-success="shopbackPicSuccess"
            :before-upload="shopbackPicUpload"
            :on-progress="progress1"
            name="fileName"
          >
            <img
              v-if="form.shopbackPic"
              :src="form.shopbackPic"
              class="avatar"
            />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            <el-progress
              v-if="isShowJinDuTiao1"
              type="circle"
              :percentage="percentage1"
              :width="78"
              class="jdt"
            />
            <div slot="tip" class="el-upload__tip" style="color: #999999">
              上传图片大小为750px*520px
            </div>
          </el-upload>
        </el-form-item>
        <el-form-item
          label="商铺门头照片"
          prop="shopMphone"
          style="width: 380px"
        >
          <el-upload
            class="avatar-uploader"
            :action="url"
            accept=".jpg, .png"
            :headers="headers"
            :show-file-list="false"
            :on-success="shopMphoneSuccess"
            :before-upload="beforeshopMphoneUpload"
            :on-progress="progress2"
            name="fileName"
          >
            <img
              v-if="form.shopMphone"
              :src="form.shopMphone"
              class="avatar"
              :preview-src-list="srcList4"
            />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            <el-progress
              v-if="isShowJinDuTiao2"
              type="circle"
              :percentage="percentage2"
              :width="78"
              class="jdt"
            />
          </el-upload>
        </el-form-item>
        <el-form-item label="商铺营业执照" prop="shopBusinessLicense">
          <el-upload
            class="avatar-uploader"
            :action="url"
            accept=".jpg, .png"
            :headers="headers"
            :show-file-list="false"
            :on-success="shopBusinessLicenseSuccess"
            :before-upload="beforeshopBusinessLicenseUpload"
            :on-progress="progress3"
            name="fileName"
          >
            <img
              v-if="form.shopBusinessLicense"
              :src="form.shopBusinessLicense"
              class="avatar"
              :preview-src-list="srcList5"
            />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            <el-progress
              v-if="isShowJinDuTiao3"
              type="circle"
              :percentage="percentage3"
              :width="78"
              class="jdt"
            />
          </el-upload>
        </el-form-item>
        <el-form-item label="商户标签1" prop="shoptype1">
          <el-input v-model="form.shoptype1" placeholder="请输入商户标签" />
        </el-form-item>
        <el-form-item label="商户标签2" prop="shoptype2">
          <el-input v-model="form.shoptype2" placeholder="请输入商户标签" />
        </el-form-item>
        <el-form-item label="商户标签3" prop="shoptype3">
          <el-input v-model="form.shoptype3" placeholder="请输入商户标签" />
        </el-form-item>
        <el-form-item label="商户名称" prop="shopname">
          <el-input v-model="form.shopname" placeholder="请输入商户名称" />
        </el-form-item>
        <el-form-item
          label="商户排序"
          prop="shopTop"
          v-if="this.quanxian == false"
        >
          <el-input v-model="form.shopTop" placeholder="请输入商户排序" />
        </el-form-item>
        <el-form-item label="商家账号" prop="shopnumber">
          <el-input
            v-model="form.shopnumber"
            placeholder="请输入商家账号"
            :disabled="true"
          />
        </el-form-item>
        <el-form-item label="商家密码" prop="">
          <el-input v-model="form.password" placeholder="请输入商家密码" />
        </el-form-item>
        <!-- 1--金 2--银 3--优选商家 -->
        <el-form-item
          label="商家等级"
          prop="type"
          v-if="this.quanxian == false"
        >
          <el-select
            v-model="form.type"
            placeholder="请输入商家等级"
            clearable
            style="width: 204px"
          >
            <el-option
              v-for="dict in type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="当前负责人" prop="shopuser">
          <el-input v-model="form.shopuser" placeholder="请输入当前负责人" />
        </el-form-item>
        <el-form-item label="客服电话" prop="shoptel">
          <el-input
            v-model="form.shoptel"
            placeholder="请输入门店接听电话"
            maxlength="11"
            oninput="value=value.replace(/[^0-9-]+/,'')"
          />
        </el-form-item>
        <!-- 1--婚纱摄影  2--婚纱礼服  3--婚礼策划  4--婚宴酒店 -->
        <el-form-item
          label="商家类型"
          prop="shopType"
          v-if="this.quanxian == false"
        >
          <el-select
            v-model="form.shopType"
            placeholder="请输入商家类型"
            disabled
            clearable
            style="width: 204px"
          >
            <el-option
              v-for="dict in shopType"
              :key="dict.key"
              :label="dict.label"
              :value="dict.label"
            />
          </el-select>
        </el-form-item>
        <!-- 0--正常  1--关闭 -->
        <el-form-item
          label="商家状态"
          prop="state"
          v-if="this.quanxian == false"
        >
          <el-select
            v-model="form.state"
            placeholder="请输入商家状态"
            clearable
            style="width: 204px"
          >
            <el-option
              v-for="dict in state"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="地图搜索">
          <el-amap-search-box
            ref="searchBox"
            class="search-box"
            style="width: 560px; height: 36px"
            :default="defaultValue"
            :search-option="searchOption"
            :on-search-result="onSearchResult"
            @input="searchValue = $event.target.value"
          >
          </el-amap-search-box>
        </el-form-item>
        <!-- 搜索 -->
        <el-form-item label="地图">
          <el-amap
            ref="map"
            vid="amapDemo"
            :events="events"
            :center="center"
            :zoom="zoom"
            class="amap-demo"
            style="width: 560px; height: 180px"
          >
            <el-amap-marker :position="center" key="100"></el-amap-marker>
          </el-amap>
          <!-- 地图 -->
        </el-form-item>
        <el-form-item label="商家地址" prop="shopaddress" style="width: 350px">
          {{ form.shopaddress || "请在地图上选择商家地址" }}
          <!-- <el-input v-model.trim="form.shopaddress" placeholder="请在地图上搜索商家地址" /> -->
        </el-form-item>
        <el-form-item label="商家详细地址" prop="shopaddressb">
          <el-input
            placeholder="请输入商家详细地址"
            v-model="form.shopaddressb"
          ></el-input>
        </el-form-item>
        <el-form-item label="商家经纬度" prop="shopJwd" style="width: 350px">
          {{ form.shopJwd || "请在地图上选择商家地址" }}
          <!-- <el-input v-model.trim="form.shopJwd" placeholder="如111.1111,111.1111"></el-input> -->
        </el-form-item>
        <el-form-item label="商家简介" prop="shopbrief">
          <el-input
            v-model="form.shopbrief"
            type="textarea"
            placeholder="请输入商家简介"
          ></el-input>
        </el-form-item>
        <el-form-item label="最高价格" prop="shopmaxPrice">
          <el-input v-model="form.shopmaxPrice" placeholder="请输入最高价格" />
        </el-form-item>
        <el-form-item label="最低价格" prop="shopminPrice">
          <el-input v-model="form.shopminPrice" placeholder="请输入最低价格" />
        </el-form-item>
        <el-form-item
          label="客资扣费标准"
          prop="shopspendCmMoney"
          v-if="this.quanxian == false"
        >
          <el-input
            v-model="form.shopspendCmMoney"
            placeholder="请输入客资扣费标准"
          />
        </el-form-item>
        <!-- <el-form-item label="成交订单扣费界限" prop="shopxiane" v-if="this.quanxian == true">
                    <el-input v-model.trim="form.shopxiane" placeholder="成交订单扣费界限" />
                </el-form-item> -->
        <el-form-item
          label="成交扣费标准"
          prop="shopspendDealMoney"
          v-if="this.quanxian == false"
        >
          <el-input
            v-model="form.shopspendDealMoney"
            placeholder="请输入成交扣费标准"
          />
        </el-form-item>
        <!--成交扣费比率min=1% max=100%  -->
        <el-form-item
          label="成交扣费比率"
          prop="shoprate"
          style="width: 705px"
          v-if="this.quanxian == false"
        >
          <!-- <el-input v-model="form.shoprate" placeholder="请输入成交扣费比率,如5%" /> -->
          <template>
            <el-slider v-model="form.shoprate" show-input></el-slider>
          </template>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" :disabled="lock1" @click="xiugai"
          >确 定</el-button
        >
        <el-button @click="quxiao">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 查看对话框 -->
    <el-dialog
      :title="title2"
      :visible.sync="open2"
      width="800px"
      append-to-body
    >
      <el-form ref="form" :model="form" label-width="150px" :disabled="edit">
        <el-form-item
          label="店铺商家logo或头像"
          prop="shoplogo"
          style="width: 350px"
        >
          <el-upload
            class="avatar-uploader"
            :action="url"
            accept=".jpg, .png"
            :headers="headers"
            :show-file-list="false"
            :on-success="handleAvatarSuccess"
            :before-upload="beforeAvatarUpload"
            name="fileName"
          >
            <el-image
              v-if="form.shoplogo"
              :src="form.shoplogo"
              class="avatar"
              :preview-src-list="srcList"
            >
            </el-image>
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        </el-form-item>
        <el-form-item label="店铺背景图片" prop="shopbackPic">
          <el-upload
            class="avatar-uploader"
            :action="url"
            accept=".jpg, .png"
            :headers="headers"
            :show-file-list="false"
            :on-success="shopbackPicSuccess"
            :before-upload="shopbackPicUpload"
            name="fileName"
          >
            <el-image
              v-if="form.shopbackPic"
              :src="form.shopbackPic"
              class="avatar"
              :preview-src-list="srcList1"
            ></el-image>
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        </el-form-item>
        <el-form-item
          label="商铺门头照片"
          prop="shopMphone"
          style="width: 350px"
        >
          <el-upload
            class="avatar-uploader"
            :action="url"
            accept=".jpg, .png"
            :headers="headers"
            :disabled="true"
            :show-file-list="false"
            :on-success="shopMphoneSuccess"
            :before-upload="beforeshopMphoneUpload"
            name="fileName"
          >
            <el-image
              v-if="form.shopMphone"
              :src="form.shopMphone"
              class="avatar"
              :preview-src-list="srcList6"
            >
            </el-image>
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        </el-form-item>
        <el-form-item label="商铺营业执照" prop="shopBusinessLicense">
          <el-upload
            class="avatar-uploader"
            :action="url"
            accept=".jpg, .png"
            :headers="headers"
            :disabled="true"
            :show-file-list="false"
            :on-success="shopBusinessLicenseSuccess"
            :before-upload="beforeshopBusinessLicenseUpload"
            name="fileName"
          >
            <el-image
              v-if="form.shopBusinessLicense"
              :src="form.shopBusinessLicense"
              class="avatar"
              :preview-src-list="srcList7"
            ></el-image>
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        </el-form-item>
        <el-form-item label="商户标签1" prop="shoptype1">
          <el-input v-model="form.shoptype1" placeholder="请输入商户标签" />
        </el-form-item>
        <el-form-item label="商户标签2" prop="shoptype2">
          <el-input v-model="form.shoptype2" placeholder="请输入商户标签" />
        </el-form-item>
        <el-form-item label="商户标签3" prop="shoptype3">
          <el-input v-model="form.shoptype3" placeholder="请输入商户标签" />
        </el-form-item>
        <el-form-item label="商户名称" prop="shopname">
          <el-input v-model="form.shopname" placeholder="请输入商户名称" />
        </el-form-item>
        <el-form-item
          label="商户排序"
          prop="shopTop"
          v-if="this.quanxian == false"
        >
          <el-input v-model="form.shopTop" placeholder="请输入商户排序" />
        </el-form-item>
        <el-form-item label="商家账号" prop="shopnumber">
          <el-input
            v-model="form.shopnumber"
            placeholder="请输入商家账号"
            :disabled="true"
          />
        </el-form-item>
        <!-- 1--金 2--银 3--优选商家 -->
        <el-form-item
          label="商家等级"
          prop="type"
          v-if="this.quanxian == false"
        >
          <el-select
            v-model="form.type"
            placeholder="请输入商家等级"
            clearable
            style="width: 204px"
          >
            <el-option
              v-for="dict in type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="当前负责人" prop="shopuser">
          <el-input v-model="form.shopuser" placeholder="请输入当前负责人" />
        </el-form-item>
        <el-form-item label="客服电话" prop="shoptel">
          <el-input v-model="form.shoptel" placeholder="请输入门店接听电话" />
        </el-form-item>
        <!-- 1--婚纱摄影  2--婚纱礼服  3--婚礼策划  4--婚宴酒店 -->
        <el-form-item
          label="商家类型"
          prop="shopType"
          v-if="this.quanxian == false"
        >
          <el-select
            v-model="form.shopType"
            placeholder="请输入商家类型"
            clearable
            style="width: 204px"
          >
            <el-option
              v-for="dict in shopType"
              :key="dict.key"
              :label="dict.label"
              :value="dict.label"
            />
          </el-select>
        </el-form-item>
        <!-- 0--正常  1--关闭 -->
        <el-form-item
          label="商家状态"
          prop="state"
          v-if="this.quanxian == false"
        >
          <el-select
            v-model="form.state"
            placeholder="请输入商家状态"
            clearable
            style="width: 204px"
          >
            <el-option
              v-for="dict in state"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="商家地址" prop="shopaddress">
          {{ form.shopaddress || "请在地图上选择商家地址" }}
        </el-form-item>
        <el-form-item label="商家详细地址" prop="shopaddressb">
          <el-input
            placeholder="请输入商家详细地址"
            v-model="form.shopaddressb"
          ></el-input>
        </el-form-item>
        <el-form-item label="商家经纬度" prop="shopJwd">
          {{ form.shopJwd || "请在地图上选择商家地址" }}
        </el-form-item>
        <el-form-item label="商家简介" prop="shopbrief">
          <el-input
            v-model="form.shopbrief"
            type="textarea"
            placeholder="请输入商家简介"
          ></el-input>
        </el-form-item>
        <el-form-item label="最高价格" prop="shopmaxPrice">
          <el-input v-model="form.shopmaxPrice" placeholder="请输入最高价格" />
        </el-form-item>
        <el-form-item label="最低价格" prop="shopminPrice">
          <el-input v-model="form.shopminPrice" placeholder="请输入最低价格" />
        </el-form-item>
        <el-form-item
          label="客资扣费标准"
          prop="shopspendCmMoney"
          v-if="this.quanxian == false"
        >
          <el-input
            v-model="form.shopspendCmMoney"
            placeholder="请输入客资扣费标准"
          />
        </el-form-item>
        <!-- <el-form-item label="成交订单扣费界限" prop="shopxiane" v-if="this.quanxian == true">
                    <el-input v-model.trim="form.shopxiane" placeholder="成交订单扣费界限" />
                </el-form-item> -->
        <el-form-item
          label="成交扣费标准"
          prop="shopspendDealMoney"
          v-if="this.quanxian == false"
        >
          <el-input
            v-model="form.shopspendDealMoney"
            placeholder="请输入成交扣费标准"
          />
        </el-form-item>
        <!--成交扣费比率min=1% max=100%  -->
        <el-form-item
          label="成交扣费比率"
          prop="shoprate"
          style="width: 705px"
          v-if="this.quanxian == false"
        >
          <template>
            <el-slider v-model="form.shoprate" show-input></el-slider>
          </template>
        </el-form-item>
      </el-form>
    </el-dialog>

    <el-dialog
      title="充值"
      :visible.sync="czOpen"
      width="650px"
      append-to-body
      top="25vh"
      :show-close="true"
    >
      <div class="cz_ye">
        <span>当前客资余额：{{ kzye }} 当前成交余额：{{ cjye }} </span>
      </div>
      <div class="cz_way">
        <div class="czfs">
          <div class="cz_label">充值方式：</div>
          <el-radio-group v-model="chongzhi.type">
            <el-radio :label="3" style="margin-right: 20px">客资余额</el-radio>
            <el-radio :label="6">成交余额</el-radio>
          </el-radio-group>
        </div>
        <div class="czfs" style="margin-top: 20px">
          <div class="cz_label">充值方式：</div>
          <div class="cz_r">
            <el-radio v-for="item in radioOptions" :key="item.value" v-model="chongzhi.money" :label="item.value" style="margin-top: 10px">
              {{ item.label }}
            </el-radio>
          </div>
        </div>
      </div>
      <div class="tip">
        <div class="tip_body">
          <div class="tip_title">充值说明：</div>
          <div class="tip_text">
            <div>①成功充值后 充值金额会对应到您的账户余额;</div>
            <div>②选择或支付过程中，遇到任何问题请及时与我们联系</div>
          </div>
        </div>
        <div class="tip_body" style="margin-top: 15px">
          <div class="tip_title">关于发票：</div>
          <div class="tip_text">
            <div>如需开发票请与我们联系:微信/电话:13772186260</div>
          </div>
        </div>
      </div>
      <div
        slot="footer"
        class="dialog-footer"
        style="display: flex; align-items: center;justify-content: flex-end;"
      >
        <el-button @click="cancelZF">取 消</el-button>
        <el-button type="primary" @click="chongzhiZf">立即支付</el-button>
      </div>
    </el-dialog>

    <el-drawer
      title="详细信息"
      :visible.sync="drawer"
      :direction="direction"
      size="60%"
      :before-close="handleClose"
    >
      <div class="drawer">
        <div class="header">
          <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="店铺信息" name="first"></el-tab-pane>
            <el-tab-pane label="商家客资" name="second"></el-tab-pane>
            <el-tab-pane label="本店员工" name="third"></el-tab-pane>
            <el-tab-pane label="消费明细" name="fourth"></el-tab-pane>
          </el-tabs>
        </div>

<!--        商家客资窗口-->
        <div class="search_bar" v-if="tabIndex == 1">
          <div class="kz_name">
            <div style="width: 56px; margin-right: 10px">客资姓名</div>
            <el-input
              v-model="thisShopKzQuery.kzName"
              placeholder="请输入"
              size="mini"
              style="width: 150px"
            ></el-input>
          </div>
          <div class="kh_status">
            <div style="width: 56px; margin-right: 10px">客户状态</div>
            <el-select size="mini" v-model="thisShopKzQuery.typeid" placeholder="用户状态" clearable style="width: 150px">
              <el-option v-for="dict in typeid" :key="dict.value" :label="dict.label" :value="dict.value" />
            </el-select>
          </div>
          <div class="fp_time">
            <div style="width: 56px; margin-right: 10px">分配时间</div>
            <el-date-picker v-model="thisShopKzQuery.starttime" type="date" placeholder="开始时间" value-format="timestamp"
                            :picker-options="startDatePicker" style="width: 180px">
            </el-date-picker>
            <el-date-picker v-model="thisShopKzQuery.endtime" type="date" value-format="timestamp"
                            :picker-options="endDatePicker" placeholder="结束时间" style="width: 180px">
            </el-date-picker>
          </div>
          <div class="search_btn">
            <el-button type="primary" size="small" @click="getThisShopKzList()">查询</el-button>
            <el-button size="small" @click="resetShopKzQuery()">重置</el-button>
          </div>
        </div>
        <div class="table_part" v-if="tabIndex == 1">
          <el-table
            v-loading="loading"
            :data="detailList"
            @selection-change="handleSelectionChange"
            max-height="725"
            :row-style="rowStyle1"
          >
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="客资ID" align="center" prop="kzId" />
            <el-table-column label="客资姓名" align="center" prop="kzName" />
            <el-table-column label="联系方式" align="center" width="180">
              <template slot-scope="scope">
                <div><span>手机号：</span>{{ scope.row.kzTel }}</div>
                <div><span>微信号：</span>{{ scope.row.kzWechat }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="服务种类"
              align="center"
              prop="serveType"
              width="150"
            />
            <el-table-column label="当前状态" align="center" prop="typename"/>
            <el-table-column label="聊天及截图" align="center">
              <template slot-scope="scope">
                <div v-for="(item, index) in scope.row.img">
                  <span v-if="scope.row.img == ''">{{ '暂无' }}</span>
                  <el-image v-else :src="item" :key="index" alt="" weight="20" style="width:40px;"
                            :preview-src-list="srcList" @click="look(scope.row)">
                  </el-image>
                </div>
              </template>
            </el-table-column>
            <el-table-column label="是否退回客资" align="center" width="150">
              <template slot-scope="scope">
                <div>{{ scope.row.typeid == 5 ? "否" : "是" }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="跟进起始时间"
              align="center"
              prop="kztoshoptime"
              width="150"
            />
            <el-table-column
              label="操作"
              align="center"
              width="180"
              fixed="right"
            >
              <template slot-scope="scope">
                <div class="cz" style="font-size: 12px !important">
                  <div class="zuofei" @click="handleGJ(scope.row)">
                    <img src="@/assets/images/detail.png" alt="" />
                    <span style="color: #23bb7b">跟进记录</span>
                  </div>
                  <div class="transform_seller" @click="handleCJ(scope.row)">
                    <img
                      src="@/assets/images/order.png"
                      alt=""
                      style="width: 14px; height: 14px"
                    />
                    <span style="color: #5672fa">订单成交</span>
                  </div>
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>
<!--   本店员工     -->
        <div class="search_bar1" v-if="tabIndex == 2">
          <div style="display: flex;justify-content: flex-start;align-items: center;width: 100%;margin-bottom: 10px;">
            <div class="kz_name" style="margin-right: 30px;">
            <div style="width: 36px; margin-right: 5px;">姓名</div>
            <el-input
              v-model="thisShopUserQuery.userName"
              placeholder="请输入"
              size="mini"
              style="width: 150px"
            ></el-input>
          </div>
          <div class="kh_status">
            <div style="width: 36px; margin-right: 10px">账号</div>
            <el-input
              v-model="thisShopUserQuery.nickName"
              placeholder="请输入"
              size="mini"
              style="width: 150px"
            ></el-input>
          </div>
          </div>
          <div style="display: flex;justify-content: flex-start;align-items: center;width: 100%;">
            <div class="mobile" style="margin-right: 30px;">
            <div style="width: 56px; margin-right: 10px">手机号</div>
            <el-input
              v-model="thisShopUserQuery.phonenumber"
              placeholder="请输入"
              size="mini"
              style="width: 150px"
            ></el-input>
          </div>
          <div class="fp_time" style="margin-right: 30px;">
            <div style="width: 56px; margin-right: 10px">入职时间</div>
            <el-date-picker
              v-model="timePicker"
              type="datetimerange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              size="small"
              style="width: 328px"
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss">
            >
            </el-date-picker>
          </div>
          <div class="search_btn">
            <el-button type="primary" size="small" @click="getThisShopUserList()">查询</el-button>
            <el-button size="small" @click="resetShopUserQuery">重置</el-button>
          </div>
          </div>
        </div>
        <div class="table_part" v-if="tabIndex == 2">
          <el-table
            v-loading="loading"
            :data="detailList1"
            @selection-change="handleSelectionChange2"
            max-height="725"
            :row-style="rowStyle1"
          >
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="ID/账号" align="center" width="180">
                <template slot-scope="scope">
                    <div>ID：{{ scope.row.userid }}</div>
                    <div>账号：{{ scope.row.userName }}</div>
                </template>
            </el-table-column>
            <el-table-column label="姓名/联系方式" align="center" width="180">
                <template slot-scope="scope">
                    <div style="display: flex;align-items: center;">
                        <div style="margin-right: 10px;">
                            姓名：{{ scope.row.nickName }}
                        </div>
                    <img src="@/assets/images/first.png" v-if="scope.$index == 0" style="width: 24px;height: 24px;" alt="">
                    <img src="@/assets/images/second.png" v-if="scope.$index == 1" style="width: 24px;height: 24px;" alt="">
                    <img src="@/assets/images/third.png" v-if="scope.$index == 2" style="width: 24px;height: 24px;" alt="">
                    </div>
                    <div>联系方式：{{ scope.row.phonenumber }}</div>
                </template>
            </el-table-column>
            <el-table-column label="账号类型/状态" align="center" width="150">
                <template slot-scope="scope">
                    <div>类型：{{ scope.row.remark }}</div>
                    <div>状态：{{ scope.row.status == 0 ? '正常': '禁用' }}</div>
                </template>
            </el-table-column>
            <el-table-column label="领取/有效客资数" align="center" width="150">
                <template slot-scope="scope">
                    <div>领取客资数：{{ scope.row.haveKzNumber }}</div>
                    <div>有效客资数：{{ scope.row.okKz }}</div>
                </template>
            </el-table-column>
            <el-table-column label="有效成交转化率" align="center" prop="rate" width="120" />
            <el-table-column label="入职时间" align="center" prop="createTime" width="150" >
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.createTime, '{YY}-{MM}-{DD}') }}</span>
              </template>
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              width="120"
              fixed="right"
            >
              <template slot-scope="scope">

              </template>
            </el-table-column>
          </el-table>
        </div>

<!--        //消费明细-->
        <div class="search_bar1" v-if="tabIndex == 3">
          <div style="display: flex;justify-content: flex-start;align-items: center;width: 100%;margin-bottom: 10px;">
            <div class="kz_name" style="margin-right: 50px;">
            <div style="width: 56px; margin-right: 5px;">客资ID</div>
            <el-input
              v-model="thisShopXfQuery.kzId"
              placeholder="请输入"
              size="mini"
              style="width: 150px"
            ></el-input>
          </div>
          <div class="kh_status" style="margin-right: 50px;">
            <div style="width: 56px; margin-right: 10px">客户姓名</div>
            <el-input
              v-model="thisShopXfQuery.kzName"
              placeholder="请输入"
              size="mini"
              style="width: 150px"
            ></el-input>
          </div>
            <div class="mobile">
            <div style="width: 76px; margin-right: 10px">收支类型</div>
            <el-select v-model="thisShopXfQuery.type" placeholder="请选择">
                <el-option
                v-for="item in options"
                :key="item.selectValue"
                :label="item.label"
                :value="item.selectValue" size="small">
                </el-option>
            </el-select>
          </div>
          </div>
          <div style="display: flex;justify-content: flex-start;align-items: center;width: 100%;">
          <div class="fp_time" style="margin-right: 30px;">
            <div style="width: 56px; margin-right: 10px">交易时间</div>
            <el-date-picker
              v-model="timePicker"
              type="datetimerange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              size="small"
              style="width: 328px"
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss">
            >
            </el-date-picker>
          </div>
          <div class="search_btn">
            <el-button type="primary" size="small" @click="getThisShopXfList">查询</el-button>
            <el-button size="small" @click="resetXfQuery">重置</el-button>
          </div>
          </div>
        </div>
        <div class="table_part" v-if="tabIndex == 3">
          <el-table
            v-loading="loading"
            :data="detailList2"
            @selection-change="handleSelectionChange3"
            max-height="725"
            :row-style="rowStyle1"
          >
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="客资ID" align="center" prop="id" />
            <el-table-column label="订单编号" align="center" prop="ordernum" width="150" />
            <el-table-column label="客户姓名" align="center" prop="kzName" />
            <el-table-column label="客资扣费" align="center" prop="changemoney" >
              <template slot-scope="scope">
                <span v-if="scope.row.typeid==1">+{{ scope.row.changemoney }}</span>
                <span v-if="scope.row.typeid==0">-{{ scope.row.changemoney }}</span>
              </template>
            </el-table-column>
            <el-table-column label="客资扣费时间" align="center" width="180" >
              <template slot-scope="scope">
                <span>{{parseTime(scope.row.pfTime, "{YY}-{MM}-{DD}") }}</span>
              </template>
            </el-table-column>
            <el-table-column label="平台扣费" align="center" prop="shopGetMoney" />
            <el-table-column label="成交交易金额" align="center" prop="pfCjmoney" width="120" />
            <el-table-column label="收支类型"  prop="typeid" align="center" width="120">
              <template slot-scope="scope">
                <span v-if="scope.row.typeid==1">收入</span>
                <span v-if="scope.row.typeid==0">支出</span>
              </template>
            </el-table-column>
            <el-table-column label="交易时间" align="center" width="150">
              <template slot-scope="scope">
                <span>{{parseTime(scope.row.pfTime, "{YY}-{MM}-{DD}") }}</span>
              </template>
            </el-table-column>
          </el-table>
        </div>
<!--商家基本信息-->
        <div class="basic_info" v-if="tabIndex == 0">
            <div class="basic_title">
                <div style="width: 10px;height: 10px;background: #5672FA;margin-right: 10px;border-radius: 50%;"></div>
                <div style="font-weight: 600;font-size: 16px;color: #1F2026;margin-right: 120px;">基本信息</div>
                <div @click="handleEditStatus" style="cursor: pointer;">
                    <i class="el-icon-edit"></i>
                    <span style="font-size: 14px;color: #5672FA;">{{ editStatus == 0 ? '修改' : '保存' }}</span>
                </div>
            </div>
            <div class="basic_info_body">
                <div class="row_group">
                    <div class="username row_item">
                        <div>商家名称：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{ thisShop.shopname }}</div>
                        <el-input v-model="thisShop.shopname" v-if="editStatus == 1" style="width: 320px;" placeholder="请输入"></el-input>
                    </div>
                    <div class="fzr row_item">
                        <div>当前负责人：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{ thisShop.zkwlBusinessUsPC.shopuser}}</div>
                        <el-select v-model="thisShop.zkwlBusinessUsPC.shopuser" placeholder="请选择" v-if="editStatus == 1">
                            <el-option
                            v-for="item in detailList1"
                            :key="item.userid"
                            :label="item.nickName"
                            :value="item.userid" size="small">
                            </el-option>
                        </el-select>
                    </div>
                </div>
                <div class="jd_type">
                        <div>接单类型：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{thisShop.shopType}}</div>
                        <el-select v-model="thisShop.shopType" placeholder="请选择" v-if="editStatus == 1">
                            <el-option
                            v-for="item in shopType"
                            :key="item.key"
                            :label="item.label"
                            :value="item.label" size="small">
                            </el-option>
                        </el-select>
                </div>
<!--                <div class="jd_type">-->
<!--                        <div>接单类型：</div>-->
<!--                        <div class="confirm_text" v-if="editStatus == 0">{{ basic_info.selectValue_1 }}</div>-->
<!--                        <el-select v-model="basic_info.selectValue_1" placeholder="请选择" v-if="editStatus == 1">-->
<!--                            <el-option-->
<!--                            v-for="item in options5"-->
<!--                            :key="item.selectValue"-->
<!--                            :label="item.label"-->
<!--                            :value="item.selectValue" size="small">-->
<!--                            </el-option>-->
<!--                        </el-select>-->
<!--                </div>-->
                <div style="" class="row_group">
                    <div class="level">
                        <div>商家等级：</div>
                        <div class="confirm_text" v-if="editStatus == 0">
                          <span v-if="thisShop.type == 1">诚信商家</span>
                          <span v-if="thisShop.type == 2">优选商家</span>
                          <span v-if="thisShop.type == 3">普通商家</span>
                        </div>
                        <el-select v-model="thisShop.type" placeholder="请选择" v-if="editStatus == 1">
                            <el-option
                            v-for="item in type"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value" size="small">
                            </el-option>
                        </el-select>
                    </div>
                    <div class="rank" v-if="editStatus == 0">
                        <div>商户排行：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{thisShop.shopTop}}</div>
                    </div>
                </div>
                <div style="" class="row_group">
                    <div class="level" disabled>
                        <div>商家账户：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{thisShop.zkwlBusinessUsPC.shopnumber}}</div>
                        <el-input v-model="thisShop.zkwlBusinessUsPC.shopnumber" v-if="editStatus == 1"style="width: 320px;" placeholder="请输入" disabled></el-input>
                    </div>
                    <div class="rank">
                        <div>客服电话：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{thisShop.shoptel}}</div>
                        <el-input v-model="thisShop.shoptel" style="width: 320px;" v-if="editStatus == 1" placeholder="请输入"></el-input>
                    </div>
                </div>
                <div style="" class="row_group">
                    <div class="level">
                        <div>门店大小：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{thisShop.shopArea}}</div>
                        <el-input v-model="thisShop.shopArea" style="width: 320px;" v-if="editStatus == 1" placeholder="请输入" :suffixIcon="() => 'm²'"></el-input>
                    </div>
                    <div class="rank">
                        <div>商家状态：</div>
                        <div class="confirm_text" v-if="editStatus == 0" style="color: #23BB7B;">{{basic_info.selectValue3 == '选项1' ? '正常' : '禁用'}}</div>
                        <el-select v-model="basic_info.selectValue3" placeholder="请选择" v-if="editStatus == 1">
                            <el-option
                            v-for="item in options3"
                            :key="item.selectValue"
                            :label="item.label"
                            :value="item.selectValue" size="small">
                            </el-option>
                        </el-select>
                    </div>
                </div>
                <div style="" class="row_group">
                    <div class="level">
                        <div>商家详细地址：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{thisShop.shopaddress}}</div>
                        <el-input v-model="thisShop.shopaddress" style="width: 320px;" v-if="editStatus == 1" placeholder="请输入"></el-input>
                    </div>
                    <div class="rank">
                        <div>门店销售人数：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{thisShop.staffNumber}}</div>
                        <el-input v-model="thisShop.staffNumber" style="width: 320px;" v-if="editStatus == 1" placeholder="请输入"></el-input>
                    </div>
                </div>
                <div class="jd_type">
                        <div>商家简介：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{thisShop.shopbrief}}</div>
                        <el-input
                            type="textarea"
                            :rows="3"
                            placeholder="请输入内容"
                            v-model="thisShop.shopbrief" v-if="editStatus == 1" style="width: 851px;">
                        </el-input>
                </div>
                <div style="" class="row_group">
                    <div class="level">
                        <div>最高价格：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{thisShop.shopmaxPrice}}</div>
                        <el-input v-model="thisShop.shopmaxPrice" style="width: 320px;" v-if="editStatus == 1" placeholder="请输入"></el-input>
                    </div>
                    <div class="rank">
                        <div>最低价格：</div>
                        <div class="confirm_text" v-if="editStatus == 0">{{thisShop.shopminPrice}}</div>
                        <el-input v-model="thisShop.shopminPrice" style="width: 320px;" v-if="editStatus == 1" placeholder="请输入"></el-input>
                    </div>
                </div>
                <div style="" class="row_group">
                    <div class="level">
                        <div>店铺logo/头像：</div>
                        <div class="confirm_text" v-if="editStatus == 0">
                            <img :src="thisShop.shoplogo" style="width: 74px;height: 74px;" alt="">
                        </div>
                        <el-upload
                        class="avatar-uploader"
                        action="https://jsonplaceholder.typicode.com/posts/"
                        :show-file-list="false"
                        :on-success="handleAvatarSuccess"
                        :before-upload="beforeAvatarUpload" v-if="editStatus == 1">
                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                        </el-upload>
                    </div>
                    <div class="rank">
                        <div>店铺背景图片：</div>
                        <div class="confirm_text" v-if="editStatus == 0">
                            <img :src="thisShop.shopbackPic" style="width: 74px;height: 74px;" alt="">
                        </div>
                        <el-upload
                        class="avatar-uploader"
                        action="https://jsonplaceholder.typicode.com/posts/"
                        :show-file-list="false"
                        :on-success="handleAvatarSuccess"
                        :before-upload="beforeAvatarUpload" v-if="editStatus == 1">
                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                        </el-upload>
                    </div>
                </div>
                <div style="" class="row_group">
                    <div class="level">
                        <div>店铺门头照：</div>
                        <div class="confirm_text" v-if="editStatus == 0">
                            <img :src="thisShop.shopMphone" style="width: 74px;height: 74px;" alt="">
                        </div>
                        <el-upload
                        class="avatar-uploader"
                        action="https://jsonplaceholder.typicode.com/posts/"
                        :show-file-list="false"
                        :on-success="handleAvatarSuccess"
                        :before-upload="beforeAvatarUpload" v-if="editStatus == 1">
                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                        </el-upload>
                    </div>
                    <div class="rank">
                        <div>店铺营业执照：</div>
                        <div class="confirm_text" v-if="editStatus == 0">
                            <img :src="thisShop.shopBusinessLicense" style="width: 74px;height: 74px;" alt="">
                        </div>
                        <el-upload
                        class="avatar-uploader"
                        action="https://jsonplaceholder.typicode.com/posts/"
                        :show-file-list="false"
                        :on-success="handleAvatarSuccess"
                        :before-upload="beforeAvatarUpload" v-if="editStatus == 1">
                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                        </el-upload>
                    </div>
                </div>
            </div>

            <div class="recharge" @click="recharge">
                <el-button type="primary">
                    <div style="display: flex;align-items: center;">
                        <img src="@/assets/images/recharge.png" style="width: 16px;height: 16px;margin-right: 5px;" alt="">
                        <div>充值</div>
                    </div>
                </el-button>
            </div>
        </div>

        <div class="shop_zx" v-if="tabIndex == 0">
            <div class="basic_title">
                <div style="width: 10px;height: 10px;background: #5672FA;margin-right: 10px;border-radius: 50%;"></div>
                <div style="font-weight: 600;font-size: 16px;color: #1F2026;margin-right: 120px;">店铺装修</div>
            </div>
            <div class="zx_table">
                <el-table
            v-loading="loading"
            :data="detailList3"
            @selection-change="handleSelectionChange4"
            max-height="725"
            :row-style="rowStyle1"
          >
            <el-table-column label="风格分类" align="center" prop="type" />
            <el-table-column label="封面首图" align="center" width="150">
                <template slot-scope="scope">
                    <img :src="scope.row.topImage" style="width: 40px;height: 40px;" alt="">
                </template>
            </el-table-column>
            <el-table-column label="样片数量" align="center" prop="ypNumber" />
            <el-table-column label="客片数量" align="center" prop="kpNumber" />
          </el-table>
            </div>
        </div>
      </div>
    </el-drawer>
<!--跟进记录窗口-->
    <el-dialog
      title="跟进记录"
      :visible.sync="dialogVisible"
      width="650px"
      :before-close="handleGJClose"
    >
      <div>
        <el-timeline>
          <el-timeline-item
            v-for="(item, index) in activities"
            :key="index"
            :icon="item.icon"
            :type="item.type"
            :color="item.color"
            :size="item.size"
            :timestamp="item.timestamp"
          >
            <div class="timeline_time tl_item">

              {{
                parseTime(item.changetime, "{YY}-{MM}-{DD}")
              }}
            </div>
            <div class="gjr tl_item" v-if="item.gjr !== ''">
              <span>跟进人：</span>
              {{ item.name }}
            </div>
            <div class="reason tl_item" v-if="item.reason !== ''">
              <span>退回原因：</span>
              {{ item.msg }}
            </div>
            <div class="line_tip tl_item">
              <span>备注：</span>
              {{ item.remark }}
            </div>
            <div class="img_group tl_item" v-if="item.imgUrl !== ''">
              <img :src="item.img" alt="" />
            </div>
          </el-timeline-item>
        </el-timeline>
      </div>
    </el-dialog>

    <el-dialog
      title="订单成交"
      :visible.sync="CJVisible"
      width="1200px"
      :before-close="handleDDClose"
    >
      <div style="width: 100%; height: 100%">
        <el-table :data="CJList" style="width: 100%">
          <el-table-column  label="成交时间" width="180">
            <template slot-scope='scope'>
              <span> {{
                  parseTime(scope.row.kzOrderTime, "{YY}-{MM}-{DD}")
                }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="kzOrderMoney" label="成交金额" width="180">
          </el-table-column>
          <el-table-column label="成交凭证">
            <template slot-scope="scope">
              <img
                :src="scope.row.kzSuccessPic"
                style="width: 40px; height: 40px"
                alt=""
              />
            </template>
          </el-table-column>
          <el-table-column prop="remark" label="备注"> </el-table-column>
        </el-table>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  selectAllbusiness,
  addBusiness,
  updateBusiness,
  delBusiness,
  listBusiness,
  closeAccount,
  getOneBusness,
  daochuExcel,
  getThisShop,
  getThisShopKz,
  getThisKzFollowRecord,
  getThisShopKzOrder,
  selectAllKz,
  selectjilu,
  selectChengjiaoShop,
  selectAllshopUsers, selectliushuiAllshop, payment
} from '@/api/business/userlist.js'
import { checkPermi, checkRole } from "@/utils/permission.js";
// import { regionData, CodeToText, TextToCode } from 'element-china-area-data';
import { getToken } from "@/utils/auth";
import { AMapManager, lazyAMapApiLoaderInstance } from "vue-amap";
import allData from "@/api/kuser/level-data.js";
import { getkzlist } from '@/api/puser/userlist'
import { getThisShopUser } from '@/api/business/userlist'
import {parseTime} from "../../../utils/ruoyi";
import {selectZkwlShopLsPCkz} from "@/api/business/finace";
let amapManager = new AMapManager();
export default {
  name: "Shop",
  props: ["city", "value", "longitude", "latitude", "isEdit"],
  data() {
    let _this = this;
    return {
      lock: false,
      lock1: false,
      colorMonry: "", //获取成交/客资余额
      isShowJinDuTiao: false,
      isShowJinDuTiao1: false,
      isShowJinDuTiao2: false,
      isShowJinDuTiao3: false,
      percentage: 0,
      percentage1: 0,
      percentage2: 0,
      percentage3: 0,
      loading1: false,
      loading2: false,
      loading3: false,
      loading4: false,
      options: allData,
      srcList: [],
      srcList1: [],
      srcList4: [],
      srcList5: [],
      srcList6: [],
      srcList7: [],
      edit: true,
      quanxian: false,
      // aa:false,
      headers: {
        Authorization: "Bearer " + getToken(),
      },
      url: process.env.VUE_APP_BASE_API + "/upload/fileUpload",
      searchdata: {
        shopid: "",
      },
      amapManager,
      // shopList:{},
      // 商家地址
      // options: regionData,
      // 商家类型
      // 1--婚纱摄影  2--婚纱礼服  3--婚礼策划  4--婚宴酒店
      shopType: [
        {
          key: "1",
          label: "婚纱摄影",
        },
        {
          key: "2",
          label: "婚纱礼服",
        },
        {
          key: "3",
          label: "婚礼策划",
        },
        {
          key: "4",
          label: "婚宴酒店",
        },
      ],
      // 商家等级
      // 1--金 2--银 3--优选商家
      type: [
        {
          value: 1,
          label: "诚信商家",
        },
        {
          value: 2,
          label: "优选商家",
        },
        {
          value: 3,
          label: "普通商家",
        },
      ],
      // 员工状态
      state: [
        {
          value: 0,
          label: "正常",
        },
        {
          value: 1,
          label: "禁用",
        },
      ],
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 商家表格数据
      businessList: [],
      // 弹出层标题
      title: "",
      title1: "",
      title2: "",
      // 是否显示弹出层
      open: false,
      open1: false,
      open2: false,
      open3: false,
      defaultParams: {
        value: "name", //设置默认值value
        label: "name", //设置显示的是什么
        children: "children", //设置子元素数组是啥
      },
      searchValue: "",
      selectedOptions: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        shopname: "",
        state: "",
        starttime: "",
        endtime: "",
        shopnumber: "",
        shopuser: "",
        shoptel: "",
        shopType: "",
      },
      // 表单参数
      form: {
        center: "",
        shopaddressb: "",
        shoptype1: "",
        shoptype2: "",
        shoptype3: "",
        shopbackPic: "",
        shopname: "",
        shoplogo: "",
        shopaddress: "陕西省西安市灞桥区",
        password: "",
        type: "",
        shopuser: "",
        shopType: "",
        shopJwd: "109.06458,34.2727",
        shopbrief: "",
        shopTop: "",
        shopspendCmMoney: "",
        shopspendDealMoney: "",
        shopuser: "",
        state: "",
        shoptel: "",
        createtime: "",
        shoprate: "",
        shopnumber: "",
        shangjia_dizhi: "",
        shopBusinessLicense: "",
        shopMphone: "",
      },
      // 表单校验
      rules: {
        shopTop: [{ pattern: /^[0-9]*$/, message: "商户排序必须为数字" }],
        shopxiane: [
          {
            required: true,
            message: "商铺成交订单扣除界限不能为空",
            trigger: "blur",
          },
          {
            pattern: /^[0-9]*$/,
            message: "成交订单扣除界限必须为整数",
            trigger: "blur",
          },
        ],
        shopBusinessLicense: [
          {
            required: true,
            message: "商铺营业执照不能为空",
            trigger: "change",
          },
        ],
        shoplogo: [
          { required: true, message: "店铺logo不能为空", trigger: "change" },
        ],
        shopbackPic: [
          { required: true, message: "背景图不能为空", trigger: "change" },
        ],
        //字母加数字，共10-12位
        shopnumber: [
          { required: true, message: "商家账号不能为空", trigger: "blur" },
          {
            pattern: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{3,}$/,
            message: "商家账号长度为数字加字母至少3位",
            trigger: "blur",
          },
        ],
        // 6-10位字母加数字
        password: [
          { required: true, message: "商家密码不能为空", trigger: "blur" },
          // { pattern: /^[0-9a-zA-Z]{6,10}$/, message: '密码长度为数字加字母6到10位', trigger: 'blur' }
          {
            pattern: /^[A-Za-z0-9]+$/,
            message: "密码只能是数字和字母",
            trigger: "blur",
          },
        ],
        // 电话号验证
        shoptel: [
          { required: true, message: "客服电话不能为空", trigger: "blur" },
          // {
          //     pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
          //     message: "请输入正确的手机号码",
          //     trigger: "blur"
          // }
        ],
        shopname: [
          { required: true, message: "商户名称不能为空", trigger: "blur" },
        ],
        shopuser: [{ required: true, message: "当前负责人不能为空" }],
        shopType: [{ required: true, message: "商家类型不能为空" }],
        state: [{ required: true, message: "商家状态不能为空" }],
        shopbrief: [
          { required: true, message: "商家简介不能为空", trigger: "blur" },
        ],
        shopmaxPrice: [
          { required: true, message: "最高价格不能为空" },
          {
            pattern: /^\d+(.\d{1,2})?$/,
            message: "最高价格必须为数字保留两位小数",
            trigger: "blur",
          },
        ],
        shopminPrice: [
          { required: true, message: "最低价格不能为空" },
          {
            pattern: /^\d+(.\d{1,2})?$/,
            message: "最低价格必须为数字保留两位小数",
            trigger: "blur",
          },
        ],
        shopspendCmMoney: [
          { required: true, message: "客资扣费标准不能为空" },
          {
            pattern: /^\d+(.\d{1,2})?$/,
            message: "客资扣费标准必须为为数字保留两位小数",
            trigger: "blur",
          },
        ],
        shopspendDealMoney: [
          { required: true, message: "成交扣费标准不能为空" },
          {
            pattern: /^\d+(.\d{1,2})?$/,
            message: "成交扣费标准必须为为数字保留两位小数",
            trigger: "blur",
          },
        ],
        shopJwd: [
          { message: "经纬度不能为空" },
          {
            pattern: /^[\d\.\,]+$/,
            message: "经纬度必须是数字",
            trigger: "blur",
          },
        ],
        // 成交扣费比率min=1% max=100%
        shoprate: [
          {
            required: true,
            message: "成交扣费比率不能为空",
            trigger: "change",
          },
        ],
        //  {max: 4, message: '长度为4个字', trigger: 'blur'}
        shoptype1: [
          { required: true, message: "商家标签不能为空", trigger: "blur" },
        ],
        // shoptype2: [{
        //     max: 4, message: '长度为4个字', trigger: 'blur'
        // }],
        // shoptype3: [{
        //     max: 4, message: '长度为4个字', trigger: 'blur'
        // }],
        // shopaddress:  [{ required: true, message: "商家地址不能为空", trigger: "blur" }],
        shopaddressb: [
          { required: true, message: "商家详细地址不能为空", trigger: "blur" },
        ],
      },
      // 地图开始
      zoom: 18,
      center: [109.06458, 34.2727],
      searchOption: {
        city: "全国",
        // 限制搜索城市的范围
        citylimit: false,
      },
      defaultValue: "",
      content: "",
      inputValue: "",
      searchResult: {
        address: "",
        latitude: "",
        longitude: "",
        name: "",
        type: "",
        country: "",
        province: "",
        city: "",
        area: "",
        township: "",
        street: "",
        neighborhood: "",
        locationName: "",
      },
      events: {
        click(e) {
          _this.center = [e.lnglat.lng, e.lnglat.lat];
          // _this.form.lon = e.lnglat.lng;
          // _this.form.lat = e.lnglat.lat;
          _this.getAddress(_this.center);
          _this.defaultValue = "";
        },
      },
      dialogShow: false,
      // 地图结束
      startDatePicker: this.beginDate(),
      endDatePicker: this.processDate(),
      dc1: {
        userName: undefined,
        pageNum: 1,
        pageSize: 10,
      },
      czOpen: false,
      czTitle: "",
      kzye: "",
      cjye: "",
      radio: 3,
      radio1: 1,
      radio2: "1",
      radio3: "",
      radio4: "",
      radio5: "",

      chongzhi: {
        type: '1',
        money: '',
        leixing: '1',
        shopid: this.thisShopId,
        remark: ''
    },

      radioOptions: [
        { label: '超大框 99909元 3800个有效客户', value: '3800' },
        { label: '大框 49999元 1200个有效客户', value: '1200' },
        { label: '中框 29999元 600个有效客户', value: '600' },
        { label: '体验框 9999元 150个有效客户', value: '150' }
      ],


      drawer: false,
      direction: "rtl",
      activeName: "second",
      //当前店铺id
      thisShopId:"",

      //商家客资请求参数
      thisShopKzQuery:{
        kzName: '',
        typeid: '',
        starttime: '',
        endtime: '',
        shopid: ''
      },

      //客户状态
      typeid: [{
        value: 0,
        label: '待领取'
      }, {
        value: 1,
        label: '已领取'
      }, {
        value: 2,
        label: '活动锁单'
      }, {
        value: 3,
        label: '订单成交'
      }, {
        value: 4,
        label: '转让客资'
      }, {
        value: 5,
        label: '放弃客资'
      }, {
        value: 6,
        label: '取消订单申请'
      }, {
        value: 8,
        label: '取消订单成功'
      }, {
        value: 9,
        label: '取消订单失败'
      }, {
        value: 10,
        label: '退回客资申请'
      }, {
        value: 11,
        label: '退回客资成功'
      }, {
        value: 12,
        label: '退回客资失败'
      }, {
        value: 13,
        label: '取消活动锁单'
      }],

      //客资状态
      //  客户状态
      zhaungtai(val) {
        if (val == 0) {
          return "待领取"
        } else if (val == 1) {
          return "已领取"
        } else if (val == 2) {
          return "活动锁单"
        } else if (val == 3) {
          return "订单成交"
        } else if (val == 4) {
          return "转让客资"
        } else if (val == 5) {
          return "放弃客资"
        } else if (val == 6) {
          return "取消订单申请"
        } else if (val == 8) {
          return "取消订单成功"
        } else if (val == 9) {
          return "取消订单失败"
        } else if (val == 10) {
          return "客资退回申请"
        } else if (val == 11) {
          return "客资退回成功"
        } else if (val == 12) {
          return "客资退回失败"
        } else if (val == 13) {
          return "取消活动锁单"
        }
      },

      //本店员工请求参数
      thisShopUserQuery: {
        shopid: '',
        nickName: '',
        userName: '',
        phonenumber: '',
        startTime: '',
        endTime: '',
      },

      //交易明细
      thisShopXfQuery:{
        kzId: "",
        kzName: "",
        shopid: "",
        type:"",
        startTime: "",
        endTime: "",
        shoptel: '',
        pagenum:1,
        typeid: 0,
      },



      searchIpt1: "",
      searchIpt2: "",
      searchIpt3: "",
      searchIpt4: "",
      searchIpt5: "",
      searchIpt6: "",
      searchIpt7: "",
    //   searchIpt8: "",
      timePicker:[],
      timePicker1: "",
      timePicker2: "",
      timePicker3: "",
      detailList: [
        {
          ID: "00001",
          username: "黄格格",
          phone: "1388888888",
          wx: "1388888888",
          shopType: "摄影-写真",
          status: "已领取",
          time: "2020-05-01 12:00:00",
          screenShoot: "@/assets/images/screenshoot.png",
          isTuihui: false,
        },
      ],
      detailList1: [
      ],
      //消费明细
      detailList2: [

      ],

      //店铺风格
      detailList3: [
      ],
      tabIndex: 1,
      activities: [
        {
          title: "客资退回失败",
          time: "2024-02-24  11:54:26",
          gjr: "哈哈哈",
          reason: "添加微信多次 未通过",
          tip: "添加微信多次 未通过",
          imgUrl: "@/assets/images/screenshoot.png",
        },
        {
          title: "已领取",
          time: "2024-02-24  11:54:26",
          gjr: "",
          reason: "",
          tip: "添加微信多次 未通过",
          imgUrl: "",
        },
        {
          title: "待领取",
          time: "2024-02-24  11:54:26",
          gjr: "",
          reason: "",
          tip: "添加微信多次 未通过",
          imgUrl: "",
        },
        {
          title: "客资退回失败",
          time: "2024-02-24  11:54:26",
          gjr: "哈哈哈",
          reason: "添加微信多次 未通过",
          tip: "添加微信多次 未通过",
          imgUrl: "@/assets/images/screenshoot.png",
        },
        {
          title: "已领取",
          time: "2024-02-24  11:54:26",
          gjr: "",
          reason: "",
          tip: "添加微信多次 未通过",
          imgUrl: "",
        },
        {
          title: "待领取",
          time: "2024-02-24  11:54:26",
          gjr: "",
          reason: "",
          tip: "添加微信多次 未通过",
          imgUrl: "",
        },
      ],
      dialogVisible: false,
      CJVisible: false,
      CJList:[],
      DDData: [
        {
          time: "2024-02-15  14:35:14",
          count: "100.00",
          tip: "巴拉巴拉",
          imgUrl: "@/assets/images/screenshoot.png",
        },
        {
          time: "2024-02-15  14:35:14",
          count: "100.00",
          tip: "巴拉巴拉",
          imgUrl: "@/assets/images/screenshoot.png",
        },
        {
          time: "2024-02-15  14:35:14",
          count: "0.00",
          tip: "巴拉巴拉",
          imgUrl: "@/assets/images/screenshoot.png",
        },
        {
          time: "2024-02-15  14:35:14",
          count: "0.00",
          tip: "巴拉巴拉",
          imgUrl: "@/assets/images/screenshoot.png",
        },
        {
          time: "2024-02-15  14:35:14",
          count: "100.00",
          tip: "巴拉巴拉",
          imgUrl: "@/assets/images/screenshoot.png",
        },
        {
          time: "2024-02-15  14:35:14",
          count: "100.00",
          tip: "巴拉巴拉",
          imgUrl: "@/assets/images/screenshoot.png",
        },
      ],
      options: [{
          selectValue: '0',
          label: '支出'
        }, {
          selectValue: '1',
          label: '收入'
        }],
        options1: [{
          selectValue: '选项1',
          label: '张三'
        }, {
          selectValue: '选项2',
          label: '李四'
        }],
        options5: [{
          selectValue: '选项1',
          label: '摄影-婚纱摄影（客资扣费标准:￥99.00、成交扣费标准:￥0.00、成交扣费比率:16.34%）'
        }, {
          selectValue: '选项2',
          label: '摄影-全家福（客资扣费标准:￥99.00、成交扣费标准:￥0.00、成交扣费比率:16.34%）'
        }],
        options2: [{
          selectValue: '选项1',
          label: '等级1'
        }, {
          selectValue: '选项2',
          label: '等级2'
        },
        {
          selectValue: '选项3',
          label: '等级3'
        },],
        options3: [{
          selectValue: '选项1',
          label: '正常'
        }, {
          selectValue: '选项2',
          label: '禁用'
        }],
        editStatus: 0,
        uploadImg: '',
        uploadImg1: '',
        uploadImg2: '',
        basic_info: {
            basicInput1: '佐卡伊婚纱摄影',
            basicInput2: '文焅泓',
            basicInput9: 'a415647415236',
            basicInput3: '1500000000',
            basicInput4: '120㎡',
            basicInput5: '湖南省常德市武陵区武陵区步行街巴黎婚纱摄影',
            basicInput6: '1',
            basicInput7: '￥9999.00',
            basicInput8: '￥999.00',
            selectValue0: '张三',
            selectValue: '摄影-婚纱摄影（客资扣费标准:￥99.00、成交扣费标准:￥0.00、成交扣费比率:16.34%）',
            selectValue_1: '摄影-全家福（客资扣费标准:￥99.00、成交扣费标准:￥0.00、成交扣费比率:16.34%）',
            selectValue1: '333',
            selectValue2: '选项1',
            selectValue3: '选项1',
            rank: '诚信商户',
            JJText: '吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧啦吧吧啦吧啦吧啦吧啦',
        },
        thisShop:{

        }
    };
  },
  created() {
    this.getList();
    // 地图开始
    this.quanxian = checkRole(["shangjia"]);
    this.selectedOptions = allData;
    // 地图结束
  },
  methods: {
    parseTime,
    parsePfType(cellValue){
      if (cellValue = 1){
        return '收入';
      }else {
        return '支出';
      }
    },

    //客资状态
    checkKzStatus(cellValue){
      console.log("当前状态"+cellValue);
      if(cellValue == 1){
          return "正在审核";
      }else if (cellValue == 2){
        return "无效客资";
      }else if (cellValue==3){
        return "跟进中";
      }else if (cellValue == 4){
        return "订单成交";
      }else if (cellValue==5){
        return "客资退回";
      }else if (cellValue == 6){
        return "取消订单";
      }else if(cellValue == 0){
        return "待审核";
      }else if(cellValue == 7){
        return "审核通过";
      }else {
        return "其他";
      }
    },


    close() {
      this.reset();
      this.$refs.searchBox.$el.querySelector("input").value = "";
    },
    // 地图开始
    onSearchResult(pois) {
      //搜索
      let latSum = 0;
      let lngSum = 0;
      let that = this;
      if (pois && pois.length > 0) {
        //如果长度为1则无需转化
        let poi = pois[0];
        let lng = poi["lng"];
        let lat = poi["lat"];
        that.center = [lng, lat];
        that.zoom = 18;
        that.content = poi.name;
        that.searchResult.address = poi.address;
        that.searchResult.latitude = poi.lat;
        that.searchResult.longitude = poi.lng;
        //   that.form.lon = lng;
        //   that.form.lat = lat;
        that.getAddress(that.center);
      } else {
        that.searchResult = [];
      }
    },
    // 获取详细地址
    getAddress(center) {
      let _this = this;
      let geocoder = new AMap.Geocoder({});
      geocoder.getAddress(center, function (status, result) {
        if (status === "complete" && result.info === "OK") {
          let obj = result.regeocode.addressComponent;
          let locationName =
            obj.province +
            obj.city +
            obj.district +
            obj.township +
            obj.street +
            obj.streetNumber;
          _this.form.shopaddress = obj.province + obj.city + obj.district;
          // _this.form.shopaddress = obj.province + obj.city;
          _this.form.shopJwd = center[0] + "," + center[1];
        }
      });
    },
    // 地图结束
    // 商家地址
    handleChange(value) {
      this.queryParams.shopaddress = value[0] + value[1] + value[2];
    },
    // 上传头像
    handleAvatarSuccess(res, file) {
      this.form.shoplogo = res.data;
      this.isShowJinDuTiao = false;
      this.percentage = 0;
    },
    beforeAvatarUpload(file) {
      const isJPG = file.type === "image/jpeg";
      const isLt2M = file.size / 1024 / 1024 < 2;
      this.isShowJinDuTiao = true;
      // 校验图片比例为正方形
      const isSize = new Promise((resolve, reject) => {
          const _URL = window.URL || window.webkitURL;
          const img = new Image();
          img.onload = () => {
              // // 限制宽高必须为 1:1 比例
              const valid = img.width == img.height;
              valid ? resolve(true) : reject(false);
          };
          img.src = _URL.createObjectURL(file);
      }).then(
          () => {
              return file;
          },
          () => {
              this.$message.error('上传图片尺寸比例为1:1');
              return Promise.reject();
          },
      );
    },
    progress(event, file, fileList) {
      let num = ((event.loaded / event.total) * 100) | 0;
      this.percentage = num;
    },
    shopbackPicSuccess(res, file) {
      this.form.shopbackPic = res.data;
      this.isShowJinDuTiao1 = false;
      this.percentage1 = 0;
    },
    async shopbackPicUpload(file) {
      const isJPG = file.type === "image/jpeg";
      const isLt2M = file.size / 1024 / 1024 < 2;
      this.isShowJinDuTiao1 = true;
      // const isSize = await this.limitFileWH(750, 520, file);
      // file.isFlag = isSize;
      // return isJPG && file.isFlag;
      // console.log(file.isFlag);
      // if (file.isFlag) {
      //     return true;
      // } else {
      //     return false;
      // }
    },
    // shopbackPicUpload(file) {
    //     return new Promise((resolve, reject) => {
    //         const isJPG = file.type === 'image/jpeg' || file.type === 'image/png';
    //         this.limitFileWH(750, 520, file).then((res) => {
    //             file.isFlag = res;
    //             if (file.isFlag) {
    //                 this.isShowJinDuTiao1 = true;
    //                 resolve(true);
    //             } else {
    //                 reject(false);
    //             }
    //         });
    //     });
    // },
    //限制图片尺寸
    // limitFileWH(E_width, E_height, file) {
    //     let _this = this;
    //     let imgWidth = "";
    //     let imgHight = "";
    //     const isSize = new Promise(function (resolve, reject) {
    //         let width = E_width; let height = E_height;
    //         let _URL = window.URL || window.webkitURL;
    //         let img = new Image();
    //         img.onload = function () {
    //             imgWidth = img.width;
    //             imgHight = img.height;
    //             let valid = img.width == width && img.height == height;
    //             valid ? resolve() : reject();
    //         }
    //         img.src = _URL.createObjectURL(file);
    //     }).then(() => { return true; }, () => {
    //         _this.$message.error(
    //             { message: '上传文件的图片大小不合符标准,宽需要为' + E_width + 'px，高需要为' + E_height + 'px。当前上传图片的宽高分别为：' + imgWidth + 'px和' + imgHight + 'px', btn: false })
    //         return false;
    //     });
    //     return isSize
    // },
    progress1(event) {
      let num = ((event.loaded / event.total) * 100) | 0;
      this.percentage1 = num;
    },
    shopMphoneSuccess(res, file) {
      this.form.shopMphone = res.data;
      this.isShowJinDuTiao2 = false;
      this.percentage2 = 0;
    },
    beforeshopMphoneUpload(file) {
      const isJPG = file.type === "image/jpeg";
      const isLt2M = file.size / 1024 / 1024 < 2;
      this.isShowJinDuTiao2 = true;
    },
    progress2(event) {
      let num = ((event.loaded / event.total) * 100) | 0;
      this.percentage2 = num;
    },
    shopBusinessLicenseSuccess(res, file) {
      this.form.shopBusinessLicense = res.data;
      this.isShowJinDuTiao3 = false;
      this.percentage3 = 0;
    },
    beforeshopBusinessLicenseUpload(file) {
      const isJPG = file.type === "image/jpeg";
      const isLt2M = file.size / 1024 / 1024 < 2;
      this.isShowJinDuTiao3 = true;
    },
    progress3(event) {
      let num = ((event.loaded / event.total) * 100) | 0;
      this.percentage3 = num;
    },
    /** 查询商家列表 */
    async getList() {
      this.loading = true;
      let res = await listBusiness(this.queryParams);
      if (res.code == 200) {
        this.businessList = res.rows;
        this.total = res.total;
        this.loading = false;
        // 获取动态客资或成交金额判断列表颜色
        this.colorMonry = res.msg.split(",");
      }
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
      this.$refs.searchBox.$el.querySelector("input").value = "";
    },
    // 表单重置
    reset() {
      (this.form = {
        shopaddress: "陕西省西安市灞桥区",
        shopid: null,
        shopname: null,
        shoplogo: null,
        shopbrief: null,
        shopbackPic: null,
        shoptel: null,
        shopmaxPrice: null,
        shopminPrice: null,
        shopcmMoney: null,
        shopdealMoney: null,
        shopspendCmMoney: null,
        shopspendDealMoney: null,
        shopviewsNum: null,
        shopaskNum: null,
        shopvolNum: null,
        shopshareNum: null,
        shopcolleNum: null,
        ptId: null,
        shopTop: null,
        shopJwd: "109.06458,34.2727",
        shopType: null,
        type: null,
        shopBusinessLicense: null,
        shopMphone: null,
      }),
        (this.center = [109.06458, 34.2727]),
        (this.defaultValue = ""),
        (this.content = ""),
        (this.inputValue = ""),
        (this.searchResult = {
          address: "",
          latitude: "",
          longitude: "",
          name: "",
          type: "",
          country: "",
          province: "",
          city: "",
          area: "",
          township: "",
          street: "",
          neighborhood: "",
          locationName: "",
        }),
        this.resetForm("form");
      this.selectedOptions = [];
    },
    /** 搜索按钮操作 */
    handleQuery() {
      if (this.queryParams.starttime == "" && this.queryParams.endtime == "") {
        listBusiness(this.queryParams).then((response) => {
          this.businessList = response.rows;
          this.total = response.total;
        });
      } else if (
        this.queryParams.starttime == "" &&
        this.queryParams.endtime != ""
      ) {
        this.$modal.msgError("请输入开始时间");
      } else if (
        this.queryParams.starttime != "" &&
        this.queryParams.endtime == ""
      ) {
        this.$modal.msgError("请输入结束时间");
      } else if (
        this.queryParams.starttime != "" &&
        this.queryParams.endtime != "" &&
        this.queryParams.starttime > this.queryParams.endtime
      ) {
        this.$modal.msgError("结束时间必须大于开始时间！");
      } else if (
        this.queryParams.starttime != "" &&
        this.queryParams.endtime != "" &&
        this.queryParams.starttime < this.queryParams.endtime
      ) {
        listBusiness(this.queryParams).then((response) => {
          this.businessList = response.rows;
          this.total = response.total;
        });
      } else if (this.queryParams.startTime == this.queryParams.endTime) {
        this.$modal.msgError("结束时间必须大于开始时间！");
      }
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
        shopname: "",
        state: "",
        starttime: "",
        endtime: "",
        shopnumber: "",
        shopuser: "",
        shoptel: "",
        shopType: "",
      };
      this.selectedOptions = [];
      this.getList();
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加商家";
    },
    xinzeng() {
      this.$refs.searchBox.$el.querySelector("input").value = "";
      this.$refs["form"].validate((valid) => {
        if (valid) {
          this.lock = true;
          // console.log(this.form);
          addBusiness(this.form).then((response) => {
            if (response.data.code == 200) {
              this.$modal.msgSuccess(response.data.msg);
              this.open = false;
              this.getList();
              this.reset();
              this.lock = false;
            } else {
              this.lock = false;
              this.$modal.msgError(response.data.msg);
            }
          });
        }
      });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      this.center = [109.06458, 34.2727];
      this.searchdata.shopid = row.shopid;
      getOneBusness(this.searchdata).then((response) => {
        this.form = response.data.data;
        let strr = response.data.data.shopaddress;
        let reg = /.+?(省|市|自治区|自治州|县|区)/g;
        let cc = strr.match(reg);
        if (cc[0] != undefined && cc[1] != undefined && cc[2] != undefined) {
          this.form.shopaddress = cc[0] + cc[1] + cc[2];
        }
        if (cc[0] != undefined && cc[1] != undefined && cc[2] == undefined) {
          this.form.shopaddress = cc[0] + cc[1];
        }
        if (cc[0] != undefined && cc[1] == undefined && cc[2] == undefined) {
          this.form.shopaddress = cc[0];
        }
        // this.form.shopaddress = cc[0] + cc[1] + cc[2];
        this.form.shopnumber = response.data.data.zkwlBusinessUsPC.shopnumber;
        this.form.shopuser = response.data.data.zkwlBusinessUsPC.shopuser;
        this.form.shoprate = Number(
          response.data.data.zkwlBusinessUsPC.shoprate
        );
        this.form.state = response.data.data.zkwlBusinessUsPC.state;
        var bbbb = response.data.data.shopJwd.split(",");
        this.center = [bbbb[0], bbbb[1]];
        var sasasasa = response.data.data.shopaddress.split("/");
        this.form.shopaddress = sasasasa[0];
        // let province = string[0];
        // let city = string[1];
        // let area = string[2];
        let that = this;
        this.open1 = true;
        this.title1 = "修改商家信息";
        if (response.data.data.type == 0) {
          this.form.type = "";
        }
      });
    },
    // 修改
    xiugai() {
      this.$refs.searchBox.$el.querySelector("input").value = "";
      this.$refs["form"].validate((valid) => {
        if (valid) {
          this.lock1 = true;
          // console.log(this.form,'111111111');
          updateBusiness(this.form).then((response) => {
            if (response.data.code == 200) {
              this.$modal.msgSuccess(response.data.msg);
              this.open1 = false;
              this.lock1 = false;
              this.center = [109.06458, 34.2727];
              this.getList();
              this.reset();
            } else {
              this.lock1 = false;
              this.$modal.msgError(response.data.msg);
            }
          });
        }
      });
    },
    // 取消
    quxiao() {
      this.open1 = false;
      this.reset();
      this.$refs.searchBox.$el.querySelector("input").value = "";
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      selection.forEach((item) => {
        this.searchdata.shopid = item.shopid;
      });
      // this.single = selection.length !== 1
      // this.multiple = !selection.length
    },
    handleSelectionChange2(selection) {
      selection.forEach((item) => {
        // this.searchdata.shopid = item.shopid;
      });
      // this.single = selection.length !== 1
      // this.multiple = !selection.length
    },
    handleSelectionChange3(selection) {
      selection.forEach((item) => {
        // this.searchdata.shopid = item.shopid;
      });
      // this.single = selection.length !== 1
      // this.multiple = !selection.length
    },
    handleSelectionChange4(selection) {
      selection.forEach((item) => {
        // this.searchdata.shopid = item.shopid;
      });
      // this.single = selection.length !== 1
      // this.multiple = !selection.length
    },
    /** 删除按钮操作 */
    handleDelete(searchdata) {
      if (searchdata.shopid == "") {
        this.$modal.msgError("请先选择要处理的信息");
      } else {
        delBusiness(searchdata).then((response) => {
          this.$modal.msgSuccess("删除成功");
          this.searchdata.shopid = "";
        });
      }
      this.getList();
    },
    // 关闭账号操作
    handleClose(searchdata) {
      if (searchdata.shopid == "") {
        this.$modal.msgError("请先选择要处理的信息");
      } else {
        closeAccount(searchdata).then((response) => {
          this.$modal.msgSuccess("关闭成功");
          this.getList();
          this.searchdata.shopid = "";
        });
      }
    },
    // 更多操作触发
    handleCommand(command, row) {
      switch (command) {
        case "shopInformation":
          this.shopInformation(row);
          break;
        case "shopKz":
          this.shopKz(row);
          break;
        case "shopUser":
          this.shopUser(row);
          break;
        case "shopDecoration":
          this.shopDecoration(row);
          break;
        default:
          break;
      }
    },
    // 店铺信息操作
    shopInformation: function (row) {
      this.$router.push({
        name: "shopInformation",
        query: { shopid: row.zkwlBusinessUsPC.shopid },
      });
    },
    // 商铺客资操作
    shopKz: function (row) {
      this.$router.push({
        name: "shopKz",
        query: { shopid: row.zkwlBusinessUsPC.shopid },
      });
    },
    // 本店员工操作
    shopUser: function (row) {
      this.$router.push({
        name: "shopUser",
        // shopid: row.zkwlBusinessUsPC.shopid
        query: { shopid: row.zkwlBusinessUsPC.shopid },
      });
    },
    // 店铺装修
    shopDecoration: function (row) {
      this.$router.push({
        name: "zhuangxiu",
        query: { shopid: row.shopid, shopType: row.shopType },
      });
    },
    // 查看
    handlechakan(row) {
      this.open2 = true;
      this.title2 = "查看";
      this.searchdata.shopid = row.shopid;
      getOneBusness(this.searchdata).then((response) => {
        this.form = response.data.data;
        if (this.form.type == 0) {
          this.form.type = "";
        }
        this.srcList.push(response.data.data.shoplogo);
        this.srcList1.push(response.data.data.shopbackPic);
        this.form.shopnumber = response.data.data.zkwlBusinessUsPC.shopnumber;
        this.form.shopuser = response.data.data.zkwlBusinessUsPC.shopuser;
        this.form.shoprate = Number(
          response.data.data.zkwlBusinessUsPC.shoprate
        );
        this.form.state = response.data.data.zkwlBusinessUsPC.state;
        this.srcList6.push(response.data.data.shopMphone);
        this.srcList7.push(response.data.data.shopBusinessLicense);
        var bbbb = response.data.data.shopJwd.split(",");
        this.center = [bbbb[0], bbbb[1]];
        var sasasasa = response.data.data.shopaddress.split("/");
        this.form.shopaddress = sasasasa[0];
      });
    },
    // 验证搜索框日期
    beginDate() {
      const self = this;
      return {
        disabledDate(time) {
          //           debugger;
          if (self.endTime) {
            //如果结束时间不为空，则小于结束时间
            return new Date(self.endTime).getTime() < time.getTime();
          } else {
            return time.getTime() > Date.now(); //开始时间不选时，结束时间最大值小于等于当天
          }
        },
      };
    },
    processDate() {
      const self = this;
      return {
        disabledDate(time) {
          if (self.startTime) {
            //如果开始时间不为空，则结束时间大于开始时间
            return new Date(self.startTime).getTime() > time.getTime();
          } else {
            return time.getTime() > Date.now(); //开始时间不选时，结束时间最大值小于等于当天
          }
        },
      };
    },
    // 客资或成交金额 <= colorMonry中值时列表红色
    rowStyle({ row, rowIndex }) {
      // 客资余额：shopcmMoney，
      // 成交余额：shopdealMoney
      if (
        row.shopcmMoney <= this.colorMonry[1] ||
        row.shopdealMoney <= this.colorMonry[0]
      ) {
        let style = {
          color: "red",
        };
        return style;
      } else {
        return "";
      }
    },
    rowStyle1() {},
    // 导出
    async handleExport() {
      // this.$confirm('是否确认导出所有用户数据项?', "警告", {
      //     confirmButtonText: "确定",
      //     cancelButtonText: "取消",
      //     type: "warning"
      // }).then(function () {
      //     return daochuExcel();
      // }).then(response => {
      //     this.$download.name(response.msg);
      // }).catch(function () { });
      const queryParams = this.queryParams;
      let res = await daochuExcel(queryParams);
      if (res.code == 200) {
        this.isloading = false;
        this.$download.name(res.msg);
      }
    },

    handleCZ(row) {
      this.kzye = row.shopcmMoney;
      this.cjye = row.shopdealMoney;
      this.czOpen = true;
    },
    handleClose(done) {
      this.$confirm("确认关闭？")
        .then((_) => {
          done();
        })
        .catch((_) => {});
    },
    cancelZF() {
      this.czOpen = false;
      // this.cancelVal = ''
    },
    submitZF() {
      // if (this.cancelVal == "") {
      // this.$modal.msgError("请输入作废原因");
      // } else {
      // updateZkwlBusinessType(this.form1).then((response) => {
      //     if (response.data.code == 200) {
      //     this.$modal.msgSuccess(response.msg);
      //     this.zfOpen = false;
      //     this.cancelVal = ''
      //         this.getList();
      //     }
      // });
      // }
    },

    chongzhiZf(){
      payment(this.chongzhi).then(response => {
        if (response.data.code == 200) {
          this.czOpen = false;
          this.getList();
          this.reset();
          this.$modal.msgSuccess(response.data.msg);
        } else {
          this.$modal.msgError(response.data.msg);
        }
      });
    },

    //商家信息
    getThisShopAllMessageById(id){
      this.drawer = true;
      //获取当前店家信息
      getThisShop(id).then((response)=>{
        if (response.code == 200){
          this.thisShop = response.data;
          this.detailList3 = response.style;
        }
      });
      this.thisShopId = id;

      //获取客资列表信息
      this.thisShopKzQuery.shopid = id;
      this.getThisShopKzList();

      //获取本店员工列表
      this.thisShopUserQuery.shopid = id;
      this.getThisShopUserList();

      //获取本店消费明细
      this.thisShopXfQuery.shopid = id;
      this.getThisShopXfList();
    },

    //获取本店员工列表
    getThisShopUserList(){
      if (this.timePicker.length > 0){
        this.thisShopUserQuery.startTime = new Date(this.timePicker[0]).getTime();
        this.thisShopUserQuery.endTime = new Date(this.timePicker[1]).getTime();
      }
      if (this.thisShopUserQuery.startTime == '' && this.thisShopUserQuery.endTime == "") {
        selectAllshopUsers(this.thisShopUserQuery).then(response => {
          let that = this;
          that.detailList1 = response.data.data;
          // that.total = response.data.data.length;
        })
      } else if (this.thisShopUserQuery.startTime == "" && this.thisShopUserQuery.endTime != '') {
        this.$modal.msgError("请输入开始时间");
      } else if (this.thisShopUserQuery.startTime != '' && this.thisShopUserQuery.endTime == '') {
        this.$modal.msgError("请输入结束时间");
      } else if (this.thisShopUserQuery.startTime != '' && this.thisShopUserQuery.endTime != '' && this.thisShopUserQuery.startTime > this.thisShopUserQuery.endTime) {
        this.$modal.msgError("结束时间必须大于开始时间");
      }else if ( this.thisShopUserQuery.startTime == this.thisShopUserQuery.endTime) {
        this.$modal.msgError("结束时间必须大于开始时间");
      } else if (this.thisShopUserQuery.startTime != '' && this.thisShopUserQuery.endTime != '' && this.thisShopUserQuery.startTime < this.thisShopUserQuery.endTime) {
        selectAllshopUsers(this.thisShopUserQuery).then(response => {
          let that = this;
          that.detailList1 = response.data.data;
        })
      }
    },


    look(row) {
      this.srcList = row.img;
    },
    look3(row) {
      this.srcList3 = row.img;
    },
    //获取商家客资
    getThisShopKzList(){
      if (this.thisShopKzQuery.starttime == '' && this.thisShopKzQuery.endtime == "") {
        selectAllKz(this.thisShopKzQuery).then(response => {
          if (response.code == 200) {
            this.detailList = response.data.data;
            response.data.data.forEach(item => {
              item.img = item.img.split(',')
            })
          } else {
            this.$modal.msgError(response.data.msg);
          }
        });
      } else if (this.thisShopKzQuery.starttime == "" && this.thisShopKzQuery.endtime != '') {
        this.$modal.msgError("请输入开始时间");
      } else if (this.thisShopKzQuery.starttime != '' && this.thisShopKzQuery.endtime == '') {
        this.$modal.msgError("请输入结束时间");
      } else if (this.thisShopKzQuery.starttime != '' && this.thisShopKzQuery.endtime != '' && this.thisShopKzQuery.starttime > this.thisShopKzQuery.endtime) {
        this.$modal.msgError("结束时间必须大于开始时间");
      } else if (this.thisShopKzQuery.starttime != '' && this.thisShopKzQuery.endtime != '' && this.thisShopKzQuery.starttime < this.thisShopKzQuery.endtime) {
        selectAllKz(this.thisShopKzQuery).then(response => {
          if (response.code == 200) {
            this.detailList = response.data.data;
            response.data.data.forEach(item => {
              item.img = item.img.split(',')
            })
          } else {
            this.$modal.msgError(response.data.msg);
          }
        });
      } else if (this.thisShopKzQuery.startTime == this.thisShopKzQuery.endTime) {
        this.$modal.msgError("结束时间必须大于开始时间");
      }
    },

    //交易明细
    getThisShopXfList(){
      if (this.timePicker.length > 0){
        this.thisShopXfQuery.startTime = this.timePicker[0];
        this.thisShopXfQuery.endTime = this.timePicker[1];
      }
      selectliushuiAllshop(this.thisShopXfQuery).then(response => {
        if (response.code == 200) {
          this.detailList2 = response.data;
        }
      })
    },

    //商家客资重置
    resetShopKzQuery(){
      this.thisShopKzQuery = {
        shopid:this.thisShopId,
        kzName: '',
        typeid: '',
        starttime: '',
        endtime: '',
      };
      this.getThisShopKzList();
    },

    //本店员工重置
    resetShopUserQuery(){
      this.thisShopUserQuery = {
        shopid: this.thisShopId,
        nickName: '',
        userName:"",
        phonenumber: '',
        startTime: '',
        endTime: ''
      };
      this.timePicker = [];
      this.getThisShopUserList();
    },

    //消费明细
    resetXfQuery(){
      this.thisShopXfQuery={
        kzId: "",
        kzName: "",
        shopid: this.thisShopId,
        type:"",
        startTime: "",
        endTime: "",
        shoptel: '',
        pagenum:1,
        typeid: 0,
      };
      this.timePicker = [];
      this.getThisShopXfList();
    },



    handleClick(tab, event) {
    //   console.log(tab, event);
      this.tabIndex = tab.index;
      console.log(this.tabIndex)
    },
    handleCJ(row) {
      const  kzId = row.kzId;
      this.CJVisible = true;
      selectChengjiaoShop({ kzId, shopid: this.thisShopId }).then(response => {
        if (response.data.code == 200) {
          response.data.data.forEach(item => {
            item.img = item.img.split(',');
            this.srcList3 = item.img;
          })
          this.CJList = response.data.data;
        }
      })
    },
    handleGJ(row) {
      this.dialogVisible = true;
      //调用获取跟进记录接口
      const param = {
        shopid :this.thisShopId,
        kzId:row.kzId,
      };
      console.log(param);
      selectjilu(param).then(response => {
        response.data.data.forEach(item => {
          if (item.img != '') {
            // else if (item.typeid == 6 || item.typeid == 8 || item.typeid == 9) {
            //     this.imgquxiao = item.img.split(',');
            // } else if (item.typeid == 10 || item.typeid == 11 || item.typeid == 12) {
            //     this.imgtuihui = item.img.split(',');
            // }
            if (item.typeid == 2) {
              this.imgsuodan = item.img.split(',');
            } else if (item.typeid == 3) {
              this.imgchengjiao = item.img.split(',');
            } else if (item.typeid == 4) {
              this.imgzhuanrang = item.img.split(',');
            } else if (item.typeid == 5) {
              this.imgfangqi = item.img.split(',');
            } else if (item.typeid == 13) {
              this.imgqxsuodan = item.img.split(',');
            }
          }

        });

        this.activities = response.data.data;
      })
    },
    handleGJClose() {
      this.dialogVisible = false;
    },
    handleClose() {
      this.drawer = false;
      //再次查询列表数据
      this.getList();
    },
    handleDDClose() {
      this.CJVisible = false;
    },
    handleEditStatus() {
        this.editStatus = this.editStatus == 0 ? 1 : 0;
        //保存修改的内容
        if (this.editStatus == 0) {
          updateBusiness(this.thisShop).then((respone)=>{
            if(respone.code == 200){
              this.$modal.msgSuccess(response.msg);
            }
          });
        }
    },
    recharge() {

    },
    // 时间戳转时间
    timestampToTime(timestamp, state) {
      let now = new Date(timestamp),
        y = now.getFullYear(),
        m = now.getMonth() + 1,
        d = now.getDate();
      if (state == 0) {

      } else {
        return y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d) + " " + now.toTimeString().substr(0, 8);
      }
    },

    // handleAvatarSuccess(res, file) {
    //     this.imageUrl = URL.createObjectURL(file.raw);
    //   },
    //   beforeAvatarUpload(file) {
    //     const isJPG = file.type === 'image/jpeg';
    //     const isLt2M = file.size / 1024 / 1024 < 2;
    //
    //     // if (!isJPG) {
    //     //   this.$message.error('上传头像图片只能是 JPG 格式!');
    //     // }
    //     if (!isLt2M) {
    //       this.$message.error('上传头像图片大小不能超过 2MB!');
    //     }
    //     return isLt2M;
    //   }
  },
};
</script>
<style scoped>
.el-form {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.avatar-uploader .el-upload {
  border: 1px solid #8c939d;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}

.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 78px;
  height: 78px;
  line-height: 78px;
  text-align: center;
  border: 1px solid #8c939d;
}

.avatar {
  width: 78px;
  height: 78px;
  display: block;
}

/* .search-box {
  margin-top: 6px;
  width: 100%;
}
.search-box input {
  padding: 0 15px;
  width: 100%;
  height: 32px;
  line-height: 32px;
  color: #606266;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
}
.search-box input:focus {
  border-color: #409eff;
  outline: 0;
}
.search-box input::-webkit-input-placeholder {
  color: #c0c4cc;
} */
.el-vue-search-box-container {
  border: 1px solid #dcdfe6 !important;
}

.tip-box {
  width: 100%;
  max-height: 280px;
  position: absolute;
  top: 72px;
  z-index: 10000;
  overflow-y: auto;
  background-color: #fff;
}

.amap-ui-poi-picker-sugg,
.amap_lib_placeSearch {
  border: 1px solid #eee;
  border-radius: 4px;
}

.amap-box {
  height: 200px;
}

.el-form-item {
  margin-bottom: 30px;
}

.jdt {
  position: absolute;
  top: 0px;
  left: 0px;
  background: rgba(0, 0, 0, 0.6);
}
.cz {
  display: flex;
  justify-content: center;
  align-items: center;
}
.zuofei {
  display: flex;
  align-items: center;
  margin-right: 15px;
  font-size: 5rpx;
  color: #5672fa;
  cursor: pointer;
  img {
    width: 14px;
    height: 14px;
    margin-right: 4px;
  }
}
.transform_seller {
  display: flex;
  align-items: center;
  font-size: 5rpx;
  color: #23bb7b;
  cursor: pointer;
  img {
    width: 18px;
    height: 18px;
  }
}

.czfs {
  display: flex;
  align-items: flex-start;

  .cz_label {
    width: 120px;
    font-weight: 700;
    font-size: 14px;
    color: #333333;
    margin-right: 10px;
  }
}
.cz_ye {
  margin: -20px 0 20px;
}

.cz_r {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.tip {
  width: 609px;
  height: 104px;
  background: #f5f7fa;
  margin-top: 15px;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  .tip_body {
    display: flex;
    align-items: flex-start;
    margin-top: 5px;
    .tip_title {
      font-size: 12px;
      color: #4e5969;
      font-weight: 600;
    }
    .tip_text {
      font-size: 12px;
      color: #4e5969;
    }
  }
}
.search_bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 15px;
  box-sizing: border-box;
}
.search_bar1 {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 10px 15px;
  box-sizing: border-box;
}
.header {
    padding: 10px 20px;
    box-sizing: border-box;
}

.kz_name {
  display: flex;
  align-items: center;
  color: #333333;
  font-size: 14px;
}
.kh_status {
  display: flex;
  align-items: center;
  color: #333333;
  font-size: 14px;
}
.fp_time {
  display: flex;
  align-items: center;
  color: #333333;
  font-size: 14px;
}
.mobile {
    display: flex;
  align-items: center;
  color: #333333;
  font-size: 14px;
}
.tl_item {
  margin-bottom: 10px;
}
.img_group {
  display: flex;
  align-items: center;
  img {
    width: 74px;
    height: 74px;
    margin-right: 10px;
  }
}
.basic_info {
    position: relative;
    .recharge {
        position: absolute;
        right: 10px;
        top: -10px;
    }
}

.basic_info_body {
    width: 1130px;
    /* height: 530px; */
    background: #F5F7FA;
    padding: 10px 20px;
    box-sizing: border-box;
    font-size: 14px;
    color: #B0B3B8;
    margin: 0 auto;
}
.basic_title {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    box-sizing: border-box;
}
.confirm_text {
    font-size: 14px;
    color: #4E5969;
}
.row_group {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 15px;
    .row_item {
        display: flex;
        align-items: center;
        width: 50%;
    }
}
.jd_type {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.level {
    display: flex;
    align-items: center;
    width: 50%;
}
.rank {
    display: flex;
    align-items: center;
    width: 50%;
}

.avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    background-color: #fff;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 120px;
    height: 120px;
    line-height: 120px;
    text-align: center;
  }
  .avatar {
    width: 120px;
    height: 120px;
    display: block;
  }
</style>
